• 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

Prestashop cUrl Login

Upload a file Using PHP and JavaScript

disable two buttons after clicking another button

Warning file_get_contents () failed to open stream: HTTP request failed! HTTP/1.0 402 Payment Required

Add a custom text for a particular product on specific email notification in Woocommerce

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

Return multiple values from a function using mysqli_fetch_assoc [closed]

I need to link Google Sheet with my Laravel

"Unable to load dynamic library 'pdo_sqlsrv.so' "Cenos7 PHP7.2.10

Laravel 8 factory state afterCreating

Symfony 4: "Autowire: you should configure its value explicitly."

Converting array to string and then back in PHP

How to get AJAX to post on second page?

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

How to generate QR CODE for dynamic generating link and logo using Simple QrCode in laravel?

About Contact Privacy policy Terms and conditions