Action in footer table
Hello, is it possible to insert an action in the footer of the table (getFooterActions ??)? I need to create a button that, once I have finished scrolling through the entire table, can redirect me to another page.
Now i have this in List.. resource:
protected function getHeaderActions(): array
{
return [
Action::make('showroom')
->label(__('b2brstoys.showroom.torna_a_showroom'))
->color('success')
// ->action(function () {
// return redirect(ShowroomResource::getUrl('index'));
// }),
->url(fn (): string => ShowroommarcheResource::getUrl()),
];
}
protected function getHeaderActions(): array
{
return [
Action::make('showroom')
->label(__('b2brstoys.showroom.torna_a_showroom'))
->color('success')
// ->action(function () {
// return redirect(ShowroomResource::getUrl('index'));
// }),
->url(fn (): string => ShowroommarcheResource::getUrl()),
];
}
1 Reply
I solved it this way:
In listResource:
In Resource:
In view:
protected function getShowroomAction(): Action
{
return
Action::make('showroom')
->label(__('b2brstoys.showroom.torna_a_showroom'))
->color('success')
->url(fn (): string => ShowroommarcheResource::getUrl())
;
}
protected function getShowroomAction(): Action
{
return
Action::make('showroom')
->label(__('b2brstoys.showroom.torna_a_showroom'))
->color('success')
->url(fn (): string => ShowroommarcheResource::getUrl())
;
}
public static function table(Table $table): Table
{
return $table
->searchPlaceholder(__('b2brstoys.showroom.local_search'))
->contentFooter(function () {
return view(view: 'filament.cliente.resources.showroom-resource.pages.showroom_footer');
})
...
public static function table(Table $table): Table
{
return $table
->searchPlaceholder(__('b2brstoys.showroom.local_search'))
->contentFooter(function () {
return view(view: 'filament.cliente.resources.showroom-resource.pages.showroom_footer');
})
...
<nav class="fi-pagination grid grid-cols-[1fr_auto_1fr] items-center gap-x-3 fi-ta-pagination px-3 py-3 sm:px-6">
<span></span>
<div class="col-start-2 justify-self-center">
{{ $this->getShowroomAction() }}
</div>
<span></span>
</nav>
<nav class="fi-pagination grid grid-cols-[1fr_auto_1fr] items-center gap-x-3 fi-ta-pagination px-3 py-3 sm:px-6">
<span></span>
<div class="col-start-2 justify-self-center">
{{ $this->getShowroomAction() }}
</div>
<span></span>
</nav>