• 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 Unresolvable dependency resolving [Parameter #0 [ <required> $method ]] in class GuzzleHttpPsr7Request

how to insert data into select2 search input after scan using qrcode

Symfony process run throws exception - executing on command line works

Use Python plotly chart in PHP

Download & Save Zoom Recording in directory by PHP

Not able to access model in the controller mautic

Load a .env file with PHP

How to disable widget block editor of WordPress?

Laravel Livewire: jQuery not working in child component loaded via @if statement

Upload a file Using PHP and JavaScript

How to break out of a foreach once a condition is met?

how to upload binary image to sql server using php laravel

Cannot connect to own websocket server when on secured domain

Encrypt in php and decrypt in Dart(flutter)

If you intend you use SMTP, add your SMTP Code after this Line

About Contact Privacy policy Terms and conditions