• 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

Maatwebsite Excel 3.1 : how do I skip duplicate data when imported?

Filter WooCommerce products with post__in and additional meta queries

Laravel whole batch is cancelled if one Job fails

How to make a foreign key not using primary key

How to get the total hour from starting time to end time in php

Wordpress 'post_type_link' hides permalink

PHP: Print caught exception like Xdebug

Parsing JSON File to array in PHP

laravel sanctum Route [login] not defined

enroll_table three field fetch to payment form to create payment field in laravel 5.5

how to youtube api data to print in toolset metabox using a button click before save-post

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

How to install php_imagick on wamp64

How can I solve "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"?

How do I upload a laravel project on cPanel shared hosting?

About Contact Privacy policy Terms and conditions