feat: Make TrashedFilter visible only to users with the Developer role in several Filament resources.
This commit is contained in:
parent
5ad1a702d6
commit
7d8b1eea2a
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources\Learning\Materials;
|
||||
|
||||
use App\Enums\RoleEnum;
|
||||
use App\Filament\Actions\Cheerful\DeleteAction;
|
||||
use App\Filament\Actions\Cheerful\EditAction;
|
||||
use App\Filament\Actions\Cheerful\ForceDeleteAction;
|
||||
@ -165,7 +166,8 @@ public static function table(Table $table): Table
|
||||
}),
|
||||
|
||||
TrashedFilter::make()
|
||||
->native(false),
|
||||
->native(false)
|
||||
->visible(fn () => auth()->user()->hasRole(RoleEnum::Developer)),
|
||||
])
|
||||
->recordActions([
|
||||
ViewAction::make()
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources\Master\Courses;
|
||||
|
||||
use App\Enums\RoleEnum;
|
||||
use App\Filament\Actions\Cheerful\DeleteAction;
|
||||
use App\Filament\Actions\Cheerful\EditAction;
|
||||
use App\Filament\Actions\Cheerful\ForceDeleteAction;
|
||||
@ -119,7 +120,8 @@ public static function table(Table $table): Table
|
||||
])
|
||||
->filters([
|
||||
TrashedFilter::make()
|
||||
->native(false),
|
||||
->native(false)
|
||||
->visible(fn () => auth()->user()->hasRole(RoleEnum::Developer)),
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make()
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources\Master\Lecturers\Tables;
|
||||
|
||||
use App\Enums\RoleEnum;
|
||||
use App\Enums\Sex;
|
||||
use App\Filament\Actions\Cheerful\DeleteAction;
|
||||
use App\Filament\Actions\Cheerful\EditAction;
|
||||
@ -98,7 +99,8 @@ public static function configure(Table $table): Table
|
||||
->preload(),
|
||||
|
||||
TrashedFilter::make()
|
||||
->native(false),
|
||||
->native(false)
|
||||
->visible(fn () => auth()->user()->hasRole(RoleEnum::Developer)),
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make()
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources\Master\Students\Tables;
|
||||
|
||||
use App\Enums\RoleEnum;
|
||||
use App\Enums\Sex;
|
||||
use App\Filament\Actions\Cheerful\DeleteAction;
|
||||
use App\Filament\Actions\Cheerful\EditAction;
|
||||
@ -86,7 +87,8 @@ public static function configure(Table $table): Table
|
||||
->native(false),
|
||||
|
||||
TrashedFilter::make()
|
||||
->native(false),
|
||||
->native(false)
|
||||
->visible(fn () => auth()->user()->hasRole(RoleEnum::Developer)),
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user