-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
773 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Admin\Resources; | ||
|
||
use Datlechin\FilamentMenuBuilder\Resources\MenuResource as BaseMenuResource; | ||
|
||
class MenuResource extends BaseMenuResource | ||
{ | ||
protected static bool $isScopedToTenant = false; | ||
|
||
protected static ?int $navigationSort = 33; | ||
|
||
public static function getNavigationGroup(): ?string | ||
{ | ||
return __('app.navigation.admin'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
return [ | ||
'tables' => [ | ||
'menus' => 'menus', | ||
'menu_items' => 'menu_items', | ||
'menu_locations' => 'menu_locations', | ||
], | ||
]; |
54 changes: 54 additions & 0 deletions
54
database/migrations/0001_01_30_000010_create_menus_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Datlechin\FilamentMenuBuilder\Enums\LinkTarget; | ||
use Datlechin\FilamentMenuBuilder\Models\Menu; | ||
use Datlechin\FilamentMenuBuilder\Models\MenuItem; | ||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
public function up(): void | ||
{ | ||
Schema::create(config('filament-menu-builder.tables.menus'), function (Blueprint $table) { | ||
$table->id(); | ||
$table->string('name'); | ||
$table->boolean('is_visible')->default(true); | ||
$table->timestamps(); | ||
}); | ||
|
||
Schema::create(config('filament-menu-builder.tables.menu_items'), function (Blueprint $table) { | ||
$table->id(); | ||
|
||
$table->foreignIdFor(Menu::class) | ||
->constrained() | ||
->cascadeOnDelete(); | ||
|
||
$table->foreignIdFor(MenuItem::class, 'parent_id') | ||
->nullable() | ||
->constrained($table->getTable()) | ||
->nullOnDelete(); | ||
|
||
$table->nullableMorphs('linkable'); | ||
$table->string('title'); | ||
$table->string('url')->nullable(); | ||
$table->string('target', 10)->default(LinkTarget::Self); | ||
$table->integer('order')->default(0); | ||
$table->timestamps(); | ||
}); | ||
|
||
Schema::create(config('filament-menu-builder.tables.menu_locations'), function (Blueprint $table) { | ||
$table->id(); | ||
|
||
$table->foreignIdFor(Menu::class) | ||
->constrained() | ||
->cascadeOnDelete(); | ||
|
||
$table->string('location')->unique(); | ||
$table->timestamps(); | ||
}); | ||
} | ||
}; |
Oops, something went wrong.