• 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

How to delete old images from public folder on update using Laravel

Unable to guess the mime type as no guessers are available Laravel 5.2

Magento Installation SQLSTATE[HY000] [2002] No such file or directory error

PHP header location absolute URL

Converting IPv6 to IPv4 address in PHP

PHP web3 ERC20 token function call

WAMP/Wordpress - cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received

Pass an image through AJAX [duplicate]

How to install PHP composer inside a docker container

Laravel multi auth - Authentication user provider [] is not defined

Add a text next to stock quantity if it is less than 10 in Woocommerce single product

Limit login attempts in Laravel 5.7

Laravel Model save() & update() Not Saving

Woocommerce redirect after add-to-cart error

How to programmatically find public properties of a class from inside one of it's methods

About Contact Privacy policy Terms and conditions