feat: Restrict TrashedFilter visibility to the Developer role across multiple Filament resources and apply minor code formatting adjustments.

This commit is contained in:
Yoga Pangestu 2026-01-27 15:16:37 +07:00
parent 2d3d001ea4
commit 974d8ac92b
12 changed files with 27 additions and 16 deletions

View File

@ -163,7 +163,8 @@ public static function table(Table $table): Table
])
->filters([
TrashedFilter::make()
->native(false),
->native(false)
->visible(fn () => auth()->user()?->hasRole('Developer')),
])
->recordActions([
EditJournalistAction::make('edit'),

View File

@ -306,7 +306,8 @@ public static function table(Table $table): Table
])
->filters([
TrashedFilter::make()
->native(false),
->native(false)
->visible(fn () => auth()->user()?->hasRole('Developer')),
])
->recordActions([
ViewAction::make(),

View File

@ -81,7 +81,8 @@ public static function table(Table $table): Table
])
->filters([
TrashedFilter::make()
->native(false),
->native(false)
->visible(fn () => auth()->user()?->hasRole('Developer')),
])
->recordActions([
EditAction::make()

View File

@ -83,7 +83,8 @@ public static function table(Table $table): Table
])
->filters([
TrashedFilter::make()
->native(false),
->native(false)
->visible(fn () => auth()->user()?->hasRole('Developer')),
])
->recordActions([
EditAction::make()

View File

@ -93,7 +93,8 @@ public static function table(Table $table): Table
])
->filters([
TrashedFilter::make()
->native(false),
->native(false)
->visible(fn () => auth()->user()?->hasRole('Developer')),
])
->recordActions([
EditAction::make()

View File

@ -83,7 +83,8 @@ public static function table(Table $table): Table
])
->filters([
TrashedFilter::make()
->native(false),
->native(false)
->visible(fn () => auth()->user()?->hasRole('Developer')),
])
->recordActions([
EditAction::make()

View File

@ -103,7 +103,8 @@ public static function table(Table $table): Table
])
->filters([
TrashedFilter::make()
->native(false),
->native(false)
->visible(fn () => auth()->user()?->hasRole('Developer')),
])
->recordActions([
EditAction::make()

View File

@ -99,7 +99,8 @@ public static function table(Table $table): Table
])
->filters([
TrashedFilter::make()
->native(false),
->native(false)
->visible(fn () => auth()->user()?->hasRole('Developer')),
])
->recordActions([
EditAction::make()

View File

@ -83,7 +83,8 @@ public static function table(Table $table): Table
])
->filters([
TrashedFilter::make()
->native(false),
->native(false)
->visible(fn () => auth()->user()?->hasRole('Developer')),
])
->recordActions([
EditAction::make()

View File

@ -148,7 +148,8 @@ public static function table(Table $table): Table
])
->filters([
TrashedFilter::make()
->native(false),
->native(false)
->visible(fn () => auth()->user()?->hasRole('Developer')),
])
->recordActions([
EditAction::make()

View File

@ -54,7 +54,8 @@ public static function configure(Table $table): Table
])
->filters([
TrashedFilter::make()
->native(false),
->native(false)
->visible(fn () => auth()->user()?->hasRole('Developer')),
SelectFilter::make('issue')
->label('Filter Isu')

View File

@ -40,10 +40,10 @@ public function panel(Panel $panel): Panel
mkdir($fullPath, 0777, true);
}
$files = glob($fullPath . '/*');
$files = glob($fullPath.'/*');
if (! $files || count($files) === 0) {
$defaultImage = public_path('assets/img/bg/default.jpg');
$targetImage = $fullPath . '/default.png';
$targetImage = $fullPath.'/default.png';
copy($defaultImage, $targetImage);
}
@ -53,8 +53,8 @@ public function panel(Panel $panel): Panel
->default()
->id('dashboard')
->path('dashboard')
->brandLogo(fn() => Storage::url($generalSettings->site_logo))
->favicon(fn() => Storage::url($generalSettings->site_icon))
->brandLogo(fn () => Storage::url($generalSettings->site_logo))
->favicon(fn () => Storage::url($generalSettings->site_icon))
->login(Login::class)
->registration(Registration::class)
->emailVerification(EmailVerification::class)
@ -93,7 +93,7 @@ public function panel(Panel $panel): Panel
FilamentBackgroundsPlugin::make()
->imageProvider(
MyImages::make()
->directory('storage/' . $directoryAuthBg)
->directory('storage/'.$directoryAuthBg)
),
])
->authMiddleware([