feat: Restrict TrashedFilter visibility to the Developer role across multiple Filament resources and apply minor code formatting adjustments.
This commit is contained in:
parent
2d3d001ea4
commit
974d8ac92b
@ -163,7 +163,8 @@ public static function table(Table $table): Table
|
|||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
TrashedFilter::make()
|
TrashedFilter::make()
|
||||||
->native(false),
|
->native(false)
|
||||||
|
->visible(fn () => auth()->user()?->hasRole('Developer')),
|
||||||
])
|
])
|
||||||
->recordActions([
|
->recordActions([
|
||||||
EditJournalistAction::make('edit'),
|
EditJournalistAction::make('edit'),
|
||||||
|
|||||||
@ -306,7 +306,8 @@ public static function table(Table $table): Table
|
|||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
TrashedFilter::make()
|
TrashedFilter::make()
|
||||||
->native(false),
|
->native(false)
|
||||||
|
->visible(fn () => auth()->user()?->hasRole('Developer')),
|
||||||
])
|
])
|
||||||
->recordActions([
|
->recordActions([
|
||||||
ViewAction::make(),
|
ViewAction::make(),
|
||||||
|
|||||||
@ -81,7 +81,8 @@ public static function table(Table $table): Table
|
|||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
TrashedFilter::make()
|
TrashedFilter::make()
|
||||||
->native(false),
|
->native(false)
|
||||||
|
->visible(fn () => auth()->user()?->hasRole('Developer')),
|
||||||
])
|
])
|
||||||
->recordActions([
|
->recordActions([
|
||||||
EditAction::make()
|
EditAction::make()
|
||||||
|
|||||||
@ -83,7 +83,8 @@ public static function table(Table $table): Table
|
|||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
TrashedFilter::make()
|
TrashedFilter::make()
|
||||||
->native(false),
|
->native(false)
|
||||||
|
->visible(fn () => auth()->user()?->hasRole('Developer')),
|
||||||
])
|
])
|
||||||
->recordActions([
|
->recordActions([
|
||||||
EditAction::make()
|
EditAction::make()
|
||||||
|
|||||||
@ -93,7 +93,8 @@ public static function table(Table $table): Table
|
|||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
TrashedFilter::make()
|
TrashedFilter::make()
|
||||||
->native(false),
|
->native(false)
|
||||||
|
->visible(fn () => auth()->user()?->hasRole('Developer')),
|
||||||
])
|
])
|
||||||
->recordActions([
|
->recordActions([
|
||||||
EditAction::make()
|
EditAction::make()
|
||||||
|
|||||||
@ -83,7 +83,8 @@ public static function table(Table $table): Table
|
|||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
TrashedFilter::make()
|
TrashedFilter::make()
|
||||||
->native(false),
|
->native(false)
|
||||||
|
->visible(fn () => auth()->user()?->hasRole('Developer')),
|
||||||
])
|
])
|
||||||
->recordActions([
|
->recordActions([
|
||||||
EditAction::make()
|
EditAction::make()
|
||||||
|
|||||||
@ -103,7 +103,8 @@ public static function table(Table $table): Table
|
|||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
TrashedFilter::make()
|
TrashedFilter::make()
|
||||||
->native(false),
|
->native(false)
|
||||||
|
->visible(fn () => auth()->user()?->hasRole('Developer')),
|
||||||
])
|
])
|
||||||
->recordActions([
|
->recordActions([
|
||||||
EditAction::make()
|
EditAction::make()
|
||||||
|
|||||||
@ -99,7 +99,8 @@ public static function table(Table $table): Table
|
|||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
TrashedFilter::make()
|
TrashedFilter::make()
|
||||||
->native(false),
|
->native(false)
|
||||||
|
->visible(fn () => auth()->user()?->hasRole('Developer')),
|
||||||
])
|
])
|
||||||
->recordActions([
|
->recordActions([
|
||||||
EditAction::make()
|
EditAction::make()
|
||||||
|
|||||||
@ -83,7 +83,8 @@ public static function table(Table $table): Table
|
|||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
TrashedFilter::make()
|
TrashedFilter::make()
|
||||||
->native(false),
|
->native(false)
|
||||||
|
->visible(fn () => auth()->user()?->hasRole('Developer')),
|
||||||
])
|
])
|
||||||
->recordActions([
|
->recordActions([
|
||||||
EditAction::make()
|
EditAction::make()
|
||||||
|
|||||||
@ -148,7 +148,8 @@ public static function table(Table $table): Table
|
|||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
TrashedFilter::make()
|
TrashedFilter::make()
|
||||||
->native(false),
|
->native(false)
|
||||||
|
->visible(fn () => auth()->user()?->hasRole('Developer')),
|
||||||
])
|
])
|
||||||
->recordActions([
|
->recordActions([
|
||||||
EditAction::make()
|
EditAction::make()
|
||||||
|
|||||||
@ -54,7 +54,8 @@ public static function configure(Table $table): Table
|
|||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
TrashedFilter::make()
|
TrashedFilter::make()
|
||||||
->native(false),
|
->native(false)
|
||||||
|
->visible(fn () => auth()->user()?->hasRole('Developer')),
|
||||||
|
|
||||||
SelectFilter::make('issue')
|
SelectFilter::make('issue')
|
||||||
->label('Filter Isu')
|
->label('Filter Isu')
|
||||||
|
|||||||
@ -40,10 +40,10 @@ public function panel(Panel $panel): Panel
|
|||||||
mkdir($fullPath, 0777, true);
|
mkdir($fullPath, 0777, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$files = glob($fullPath . '/*');
|
$files = glob($fullPath.'/*');
|
||||||
if (! $files || count($files) === 0) {
|
if (! $files || count($files) === 0) {
|
||||||
$defaultImage = public_path('assets/img/bg/default.jpg');
|
$defaultImage = public_path('assets/img/bg/default.jpg');
|
||||||
$targetImage = $fullPath . '/default.png';
|
$targetImage = $fullPath.'/default.png';
|
||||||
copy($defaultImage, $targetImage);
|
copy($defaultImage, $targetImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,8 +53,8 @@ public function panel(Panel $panel): Panel
|
|||||||
->default()
|
->default()
|
||||||
->id('dashboard')
|
->id('dashboard')
|
||||||
->path('dashboard')
|
->path('dashboard')
|
||||||
->brandLogo(fn() => Storage::url($generalSettings->site_logo))
|
->brandLogo(fn () => Storage::url($generalSettings->site_logo))
|
||||||
->favicon(fn() => Storage::url($generalSettings->site_icon))
|
->favicon(fn () => Storage::url($generalSettings->site_icon))
|
||||||
->login(Login::class)
|
->login(Login::class)
|
||||||
->registration(Registration::class)
|
->registration(Registration::class)
|
||||||
->emailVerification(EmailVerification::class)
|
->emailVerification(EmailVerification::class)
|
||||||
@ -93,7 +93,7 @@ public function panel(Panel $panel): Panel
|
|||||||
FilamentBackgroundsPlugin::make()
|
FilamentBackgroundsPlugin::make()
|
||||||
->imageProvider(
|
->imageProvider(
|
||||||
MyImages::make()
|
MyImages::make()
|
||||||
->directory('storage/' . $directoryAuthBg)
|
->directory('storage/'.$directoryAuthBg)
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
->authMiddleware([
|
->authMiddleware([
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user