• 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

Warning: sqlite_query() expects parameter 1 to be resource, string given

(Cache::lock()) -> get() -- Under what conditions does it return false?

Detect a fetch request in PHP

array_key_exists(): The first argument should be either a string or an integer

Cant seem to get the Pagination to work on my WooCommerce REST API application?

Nginx RTMP not recording

Remove "estimated for {country}" text after tax amount in Woocommerce checkout page

Check for PDO Results, If None Display Message, If Yes then Loop Through

(Laravel) How to delete multiple models including optional relationships?

How to get the survey List from surveygizmo API in the Postman?(Trial Version)

merging two arrays with specified index

How to generate QR CODE for dynamic generating link and logo using Simple QrCode in laravel?

Jquery DataTables: Data not displaying in table via Ajax

Prevent blank space in pdf pages (DomPdf)

Error Class "LaravelFortifyFeatures" not found

About Contact Privacy policy Terms and conditions