Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
datlechin committed Aug 1, 2024
1 parent 8da12ac commit e70b149
Show file tree
Hide file tree
Showing 15 changed files with 4,314 additions and 40 deletions.
10 changes: 10 additions & 0 deletions config/filament-menu-builder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

return [
'tables' => [
'menus' => 'menus',
'menu_items' => 'menu_items',
],
];
7 changes: 0 additions & 7 deletions config/menu-builder.php

This file was deleted.

10 changes: 6 additions & 4 deletions database/migrations/create_menus_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,29 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Datlechin\FilamentMenuBuilder\Enums\LinkTarget;
use Datlechin\FilamentMenuBuilder\Models\Menu;

return new class extends Migration
{
public function up(): void
{
Schema::create('menus', function (Blueprint $table) {
Schema::create(config('filament-menu-builder.tables.menus'), function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('location', 50);
$table->string('location', 50)->nullable();
$table->boolean('is_visible')->default(true);
$table->timestamps();
});

Schema::create('menu_items', function (Blueprint $table) {
Schema::create(config('filament-menu-builder.tables.menu_items'), function (Blueprint $table) {
$table->id();
$table->foreignIdFor(Menu::class);
$table->foreignIdFor(Menu::class, 'parent_id')->nullable();
$table->nullableMorphs('linkable');
$table->string('title');
$table->string('url');
$table->boolean('is_external')->default(false);
$table->string('target', 10)->default(LinkTarget::Self);
$table->integer('order')->default(0);
$table->timestamps();
});
Expand Down
Loading

0 comments on commit e70b149

Please sign in to comment.