• 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

Get number of working days between two dates in PHP [duplicate]

How to get rid of ampersand using WP Nonce URL and WP Redirect or PHP header

Laravel after login Two factor not working

Add bold text and line break into Laravel Notification Email

Load a .env file with PHP

Get lat/lon from google maps url ftid (hex)

Show date difference as "20" instead of "20 years ago"

Laravel PackageManifest.php: Undefined index: name

Log file is not being written in Laravel 5.5

Last order would be re-order in wooCommerce. How is it possible?

How should I get started using PHPUnit as a testing framework for a bunch of functions and classes I have already made?

Popup Window and PHP form

Whats the point of running Laravel with the command 'php artisan serve'?

Laravel relationship belongsToMany with composite primary keys

Problem with fetching data from database in Laravel

About Contact Privacy policy Terms and conditions