• 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

Check if a string contain multiple specific words

Inserting data into SQL Server Db An Invalid direction was specified

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

Unable to Edit config.inc.php

PHP's array_map including keys

Creating command to backup MySql database in Laravel

PHP each() function replacement

Cache clear probem in Larave

Transpose multidimensional array and join values with commas

Installing Composer - Internal Error

PHPSpreadsheet - How Do I Use Auto Migration Tool

storagelogs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied

Use Python plotly chart in PHP

Laravel Gates using model and returns "Using $this when not in object context" Line 28 of AzureUser model

Laravel passport auth token not working after moving to different server

About Contact Privacy policy Terms and conditions