Skip to content

Commit

Permalink
Merge pull request #30 from bdsumon4u/main
Browse files Browse the repository at this point in the history
Fixes #28
  • Loading branch information
datlechin authored Sep 15, 2024
2 parents 894ee89 + ccc7d5b commit 336efaa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion database/migrations/create_menus_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Datlechin\FilamentMenuBuilder\Enums\LinkTarget;
use Datlechin\FilamentMenuBuilder\Models\Menu;
use Datlechin\FilamentMenuBuilder\Models\MenuItem;

return new class extends Migration
{
Expand All @@ -20,7 +21,7 @@ return new class extends Migration
Schema::create(config('filament-menu-builder.tables.menu_items'), function (Blueprint $table) {
$table->id();
$table->foreignIdFor(Menu::class)->constrained()->cascadeOnDelete();
$table->foreignIdFor(Menu::class, 'parent_id')->nullable()->constrained()->nullOnDelete();
$table->foreignIdFor(MenuItem::class, 'parent_id')->nullable()->constrained($table->getTable())->nullOnDelete();
$table->nullableMorphs('linkable');
$table->string('title');
$table->string('url')->nullable();
Expand Down

0 comments on commit 336efaa

Please sign in to comment.