• 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 install ZeroMQ for PHP on an Alpine Linux container?

Laravel Excel::store file empty after stored

PHP if in_array() how to get the key as well?

PHP array slice from position + attempt to return fixed number of items

Declaration of OMDb::query(string $statement) must be compatible with PDO::query

Display Link Title Instead of URL in XSL

Woocommerce Checkout - Add conditional field required if one field is filled

PHP only Hit Counter?

image source not readable

PHPS source file - 403 Forbidden You don't have permission to access this resource

Smarty: undefined extension class 'Smarty_Internal_Method_Get_Template_Vars'

PHP array_filter with arguments

Input and output values for php into the browser?

Add rows to Single product Additional information table in WooCommerce 3.6

Need to display only array value in JSON output

About Contact Privacy policy Terms and conditions