• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Laravel: Create morphs() relationship nullable

phplaravelrelationship


PHP Snippet 1:

Schema::create('ps_assistances', function (Blueprint $table) {
    $table->bigIncrements('id');
    $table->string('assistance_number', 50)->nullable();
    $table->nullableMorphs('assitanceable');
});

PHP Snippet 2:

$table->nullableMorphs('assitanceable');

Related Snippets

Warning: mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables 11 [closed]

Using spatie/media-library, how to rename a collection of uploaded files?

How to retrieve Active Directory group policy maximum password age using LDAP

Image upload not working through ajax Laravel

Docker image build with PHP zip extension shows "bundled libzip is deprecated" warning

Required field only if another field has a value, must be empty otherwise

How to submit a form when page loads using JavaScript?

Convert regular text to array using notepad++

javascript html popup window

Laravel MSSQL Server Connection not working

Call authenticate manually in router middleware

How do I enable error reporting in Laravel?

Show date difference as "20" instead of "20 years ago"

Could not decode a text frame as UTF-8.

How to get rid of ampersand using WP Nonce URL and WP Redirect or PHP header

About Contact Privacy policy Terms and conditions