Add support in morphTo relationship for null values (1547) (#1549)

Co-authored-by: Barry vd. Heuvel <[email protected]>
This commit is contained in:
michal
2024-07-12 16:06:56 +02:00
committed by GitHub
co-authored by Barry vd. Heuvel
parent 672acce5ae
commit f7a3dc8ff2
6 changed files with 132 additions and 1 deletions
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class MorphsTable extends Migration
{
public function up(): void
{
Schema::create('morphs', function (Blueprint $table) {
$table->morphs('relation_morph_to');
$table->nullableMorphs('nullable_relation_morph_to');
});
}
}