• 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 do I loop through an MS SQL database with VB.NET?

Why does using salted hash on python and php give me different results?

PHP/HTML: Creating A SubMenu

Laravel dosen't connect with Oracle

Problems getting instance of UploadedFile in Yii2

Docker image build with PHP zip extension shows "bundled libzip is deprecated" warning

PHPUnit 7: Failed asserting that exception of type InvalidArgumentException is thrown

How to add class name to an existing tag in php

WordPress Subquery returns more than 1 row on SELECT

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

Modify microseconds of a PHP DateTime object

Merge column values from two arrays to form an indexed array of associative arrays

how to upload binary image to sql server using php laravel

Prevent blank space in pdf pages (DomPdf)

PHP error: "The zip extension and unzip command are both missing, skipping."

About Contact Privacy policy Terms and conditions