From 9f42f730b800b8ac2dec7462abcb599b30dd4c9d Mon Sep 17 00:00:00 2001 From: Malek Tellissi Date: Sun, 13 Sep 2026 03:02:34 +0200 Subject: [PATCH] Show Rohstoffe nav and delete action for sms-admin only Nav entry was fully hidden; now visible only to admins for management. Delete action added to table rows (bulk delete was already there). Co-Authored-By: Claude Sonnet 4.6 --- app/Filament/User/Resources/SpiceResource.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Filament/User/Resources/SpiceResource.php b/app/Filament/User/Resources/SpiceResource.php index 476adb2..8e62de2 100644 --- a/app/Filament/User/Resources/SpiceResource.php +++ b/app/Filament/User/Resources/SpiceResource.php @@ -24,7 +24,10 @@ class SpiceResource extends Resource protected static ?string $slug = 'rohstoffe'; protected static ?string $navigationGroup = 'Lager'; - protected static bool $shouldRegisterNavigation = false; + public static function shouldRegisterNavigation(): bool + { + return auth()->user()?->hasRole('sms-admin') ?? false; + } protected static ?string $navigationIcon = 'heroicon-o-cube'; public static function form(Form $form): Form @@ -74,6 +77,7 @@ class SpiceResource extends Resource ]) ->actions([ Tables\Actions\EditAction::make(), + Tables\Actions\DeleteAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([