• 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

Render the content of default_filter.php in Joomla front-end

Can't exclude directories from .htaccess mobile redirect?

get data-value with variable value

Add a text next to stock quantity if it is less than 10 in Woocommerce single product

OAuth2 Token PHP

is there any way to validate a field that sometime is File(image) && sometime is String(Src of same image)

How to set a domain name with php artisan serve

XAMPP keeps showing Dashboard/Welcome Page instead of the Configuration Page

woocommerce get_order_report_data to show order_item_id

Creating command to backup MySql database in Laravel

What is the difference between client-side and server-side programming?

Inserting Country Selection into MySQL PHP [duplicate]

laravel 5.6 bulk inserting json data

Guzzle Not Sending Grant Type to Laravel Passport

How to send image,audio or video through the WhatsApp API - PHP

About Contact Privacy policy Terms and conditions