• 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

Laravel with App Engine Standard Class 'FacadeIgnitionIgnitionServiceProvider' not found

Uncaught TypeError: Cannot read property 'length' of null when retrieving tags from wp

"Unable to load dynamic library 'pdo_sqlsrv.so' "Cenos7 PHP7.2.10

Malformed MIME header error in Symfony 5.3

insert multiple rows in a saveall in cakephp

how to see if database exists with PDO [duplicate]

google content api for shopping

Unable to guess the mime type as no guessers are available Laravel 5.2

Laravel Nova, route not found

Pass an image through AJAX [duplicate]

How to reset Laravel AuthManager/guards in between API calls in tests?

How to remove from a multidimensional array all duplicate elements including the original?

Twig - How to check if variable is a number / integer

Natural ORDER in Laravel Eloquent ORM

Get Header Authorization value of a login api (sent with username and password in json body) using php curl

About Contact Privacy policy Terms and conditions