• 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

Is there a way to use the same parameter into multiple place in the same query with Eloquent? [duplicate]

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null

Handling expired token in Laravel

Attempt to read property "view" on null when sending password reset email

how to check version of codeigniter framework?

Yii2: How do I debug console commands?

Laravel Mix Uncaught ReferenceError: $ is not defined

Connecting an HTML webpage to a SQL Server

Sync Records With Default Values in Pivot Tables, Call to undefined method syncWithPivotDefaults()

Popup Window and PHP form

Calculating Median of an array in PHP

How to properly start Laravel 8 with Bootstrap & authentication

laravel 5.6 bulk inserting json data

Laravel 5.5 change unauthenticated login redirect url

Google Gmail API - How to login programatically?

About Contact Privacy policy Terms and conditions