• 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

Display specific shipping method if woocommerce product has specific acf field value

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

Could not decode a text frame as UTF-8.

If action is on a different page do I use fwrite function

how to sort by a custom appended relation to model

XAMPP/SQLSRV: Unable to find Sqlsrv in PHPINFO(); - errors coming from connection

Fatal error: Uncaught Error: Call to undefined method mysqli_stmt::fetch_assoc() [duplicate]

PHP - Store information with NO database

PHP to search within txt file and echo the whole line

Laravel Carbon throws error The format separator does not match

How to run or debug php on Visual Studio Code (VSCode)

I want a way to give path to my files which are outside of public folder in laravel

PHP block shortcut in Visual Studio Code

add_action() function in wordpress not working [duplicate]

WooCommerce: Add/display Product or Variation custom field everywhere

About Contact Privacy policy Terms and conditions