• 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 solve cURL error 60: SSL certificate in Laravel 5 while Facebook authentication

laravel 5.6 bulk inserting json data

Assign output of PHP function to a variable

How to separate letters and digits from a string in php

Laravel views are showing from cache on one server but works fine on other server

Get orders by date and status woocommerce

Laravel: HTML in notification

WordPress ACFNotice: get_field() - We've detected one or more calls to retrieve ACF field values before ACF has been initialized

add uri parameter to Route name in laravel

how to create html table in php

Guzzle Not Sending Grant Type to Laravel Passport

Laravel + phpunit + github actions = Failed asserting that '1' is identical to 1

Reducing authentication calls on external API (Laravel 5.6)

How to get Laravel's CSRF Token from Another Website?

How to install php yaml on CentOs?

About Contact Privacy policy Terms and conditions