• 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

Reducing authentication calls on external API (Laravel 5.6)

Warning: sqlite_query() expects parameter 1 to be resource, string given

Shortcode or PHP inside a shortcode in Wordpress

PHP Form Not Inserting

jwt decode throws Invalid argument supplied for foreach() on php-jwt and codeignitor 4

Symfony process run throws exception - executing on command line works

Add and update products to session cart in Laravel

could not find driver Debian SQL Server PHP

php file upload scanning using clamav, permissions on /tmp/

No result using makeStyles Material UI in react 18

how to loop through json response data using ajax jquery?

How do I loop through an MS SQL database with VB.NET?

possible options to create pdf file using html elements to generate invoice in php and codeigniter

Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, null given in

PHP: Telegram Bot: Insert line break to text message

About Contact Privacy policy Terms and conditions