feat: Restrict visibility of timestamp columns to users with the Developer role.
This commit is contained in:
parent
7d8b1eea2a
commit
784b6e4f79
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Columns;
|
||||
|
||||
use App\Enums\RoleEnum;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
|
||||
class TimestampColumns
|
||||
@ -14,21 +15,24 @@ public static function make(): array
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true)
|
||||
->dateTime('l, d F Y H:i:s')
|
||||
->wrap(),
|
||||
->wrap()
|
||||
->visible(fn () => auth()->user()->hasRole(RoleEnum::Developer)),
|
||||
|
||||
TextColumn::make('updated_at')
|
||||
->label('Diperbarui')
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true)
|
||||
->dateTime('l, d F Y H:i:s')
|
||||
->wrap(),
|
||||
->wrap()
|
||||
->visible(fn () => auth()->user()->hasRole(RoleEnum::Developer)),
|
||||
|
||||
TextColumn::make('deleted_at')
|
||||
->label('Dihapus')
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true)
|
||||
->dateTime('l, d F Y H:i:s')
|
||||
->wrap(),
|
||||
->wrap()
|
||||
->visible(fn () => auth()->user()->hasRole(RoleEnum::Developer)),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user