public function table(Table $table): Table
{
/** @var ?User $user */
$user = auth()->user();
abort_if($user === null, 404);
return $table
->query(fn () => $user->tokens())
->columns([
TextColumn::make('name'),
TextColumn::make('token')
->copyable()
->copyMessage('token copied')
->formatStateUsing(fn (string $state): string => Str::mask($state, '*', 10)),
])
->recordActions([
DeleteAction::make(),
])
->toolbarActions([
DeleteBulkAction::make()
]);
}
public function table(Table $table): Table
{
/** @var ?User $user */
$user = auth()->user();
abort_if($user === null, 404);
return $table
->query(fn () => $user->tokens())
->columns([
TextColumn::make('name'),
TextColumn::make('token')
->copyable()
->copyMessage('token copied')
->formatStateUsing(fn (string $state): string => Str::mask($state, '*', 10)),
])
->recordActions([
DeleteAction::make(),
])
->toolbarActions([
DeleteBulkAction::make()
]);
}