• 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

Elasticsearch - Want to sort by field in all indices where that particular field available or not if not then avoid it

Error when uploading certain .png files "Interlace handling should be turned on when using png_read_image"

How to change product Image when variables are selected in Shop and Archive Pages?

Adding multiple items to WooCommerce cart at once

Limit login attempts in Laravel 5.7

Laravel PHP: multiple project run at the same time [closed]

How can I convert from a{a{} b{}} to a[a[],b[]] using php preg_match?

Yii2: How to download backup files using spanjeta/yii2-backup?

How to change the app environment at run time?

XSS attack still works despite htmlspecialchars() doing its work

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

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

PHP file_get_contents function

php retrieve specific data onclick from database in a list format

Laravel Model save() & update() Not Saving

About Contact Privacy policy Terms and conditions