• 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

laravel automatically deletes server.php on php artisan serve

How to edit Records using CodeIgniter

How do I call Validator from a namespace with an already existing Validator class

PHP Get value from JSON [duplicate]

How to loop sql table data inside a html table

Using spatie/media-library, how to rename a collection of uploaded files?

Remove categories with all childs derived from parent category

Debugging Stripe Webhook Event

Add 2 Webcam in one page with WebcamJS

Facebook SDK error: Cross-site request forgery validation failed. Required param "state" missing from persistent data

how to prevent float variables displaying as scientific notation when printing [duplicate]

PHP, how to convert Int value to Week days

PHP 8.1: strftime() is deprecated

Docker & Laravel : configure: error: Package requirements (oniguruma) were not met

Laravel set default language not working

About Contact Privacy policy Terms and conditions