• 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

Cannot connect to own websocket server when on secured domain

oauth-private.key does not exist or is not readable

Laravel You requested 1 items, but there are only 0 items available

PHP Discord OAUTH2 code sample not working

php file upload scanning using clamav, permissions on /tmp/

getting error while enter Command => php artisan route:list

Match csv filenames to table names and import

Attempted to call an undefined method named "get" of class "MailController"

dompdf and img tag, image wont show

Add Class in html Dynamically in PHP

Laravel Factory not calling callback 'afterCreating'

api response laravel doesn't show

PHP - CURL using HTTPS [closed]

How to create a video stream from a single dynamic image in PHP

PHP sort array of objects by two properties

About Contact Privacy policy Terms and conditions