F
Filament2mo ago
Tieme

Override Table::configureUsing

Hi All, I have below in my app service provider
\Filament\Tables\Table::configureUsing(function (\Filament\Tables\Table $table): void {
$table
->modifyUngroupedRecordActionsUsing(fn (Action $action) => $action->iconButton())
});
\Filament\Tables\Table::configureUsing(function (\Filament\Tables\Table $table): void {
$table
->modifyUngroupedRecordActionsUsing(fn (Action $action) => $action->iconButton())
});
Now i have a table where i need the action to be a link. i have tried below, but the configureUsing is still being applied, and the action is still a iconButton, Is this a bug or a feature?
return $table
->columns([
View::make('filament.user.resources.companies.table.columns.company'),
])
->recordActions([
ViewAction::make()
->label(__('filament-actions::view.single.label'))
->link(),
]);
return $table
->columns([
View::make('filament.user.resources.companies.table.columns.company'),
])
->recordActions([
ViewAction::make()
->label(__('filament-actions::view.single.label'))
->link(),
]);
Thanks for the support
1 Reply
Tieme
TiemeOP2mo ago
For now i solved it doing, but want to know if it is possible like i have in my question.
\Filament\Tables\Table::configureUsing(function (\Filament\Tables\Table $table): void {
$table
->modifyUngroupedRecordActionsUsing(function (Action $action) {
$arguments = $action->getArguments();
if ($arguments) {
if (array_key_exists('is_link', $arguments) and $arguments['is_link'] == true) {
return $action->link();
}
}

return $action->iconButton();
});
});
\Filament\Tables\Table::configureUsing(function (\Filament\Tables\Table $table): void {
$table
->modifyUngroupedRecordActionsUsing(function (Action $action) {
$arguments = $action->getArguments();
if ($arguments) {
if (array_key_exists('is_link', $arguments) and $arguments['is_link'] == true) {
return $action->link();
}
}

return $action->iconButton();
});
});
ViewAction::make()
->label(__('filament-actions::view.single.label'))
->arguments([
'is_link' => true,
]),
ViewAction::make()
->label(__('filament-actions::view.single.label'))
->arguments([
'is_link' => true,
]),

Did you find this page helpful?