• 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 Route issues with Route order in web.php

Sum array values of a column within each column of an array with 3 levels

PHP drop down list using array's and foreach (else and for) code

Add Class in html Dynamically in PHP

PHP: How to solve ob_start() in combination imagepng() issue?

Adding custom body class to the custom archive pages

How do I enable error reporting in Laravel?

Boolean assignment operators in PHP

Hide specific products from unlogged users based in product category in WooCommerce

how to use extended ASCII instead of unicode in PHP

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

enable Apache http Authorization header

How to get monthly wise data in laravel

Get WooCommerce products from specific category

how to create html table in php

About Contact Privacy policy Terms and conditions