• 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

file_put_content...fail to open stream:Permission denied in Laravel 5

php mysql + create a friend request system

protect my blog content

Detect emoticons in string

Installing Composer - Internal Error

Laravel PackageManifest.php: Undefined index: name

target [LaravelFortifyContractsRegisterViewResponse] is not instantiable

Laravel 5.1 xmlHttpRequest AJAX POST TokenMismatchException

Add a text next to stock quantity if it is less than 10 in Woocommerce single product

Clear javascript source cache laravel 5.8

"Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP

Testing subscription renewals on Stripe

PHP - installing Xdebug on Mac with XAMPP (Unix File)

XSS attack still works despite htmlspecialchars() doing its work

Laravel after login Two factor not working

About Contact Privacy policy Terms and conditions