F
Filamentβ€’8mo ago
Hurruwa

Custom Infolist Entry Action

Im trying to add an Action to a custom Infolist Entry Component but im hitting a wall with this error... This is the code inside the Infolist Component reffering to the action:
use Filament\Infolists\Components\Actions\Action;

public function getItemAction($record): Action
{
return Action::make('viewActivity')
->iconButton()
->icon('heroicon-o-eye')
->modalHeading('View Action')
->modalDescription('View the activity details.')
->slideOver()
->modalWidth('xl')
->modalContent(fn() => view('filament.pages.view-activity', ['activity' => $record]));
}
use Filament\Infolists\Components\Actions\Action;

public function getItemAction($record): Action
{
return Action::make('viewActivity')
->iconButton()
->icon('heroicon-o-eye')
->modalHeading('View Action')
->modalDescription('View the activity details.')
->slideOver()
->modalWidth('xl')
->modalContent(fn() => view('filament.pages.view-activity', ['activity' => $record]));
}
Thanks in advance, any info to at least understand what's happening its welcome XD
3 Replies
Povilas K
Povilas Kβ€’8mo ago
I don't see the actual error message, did you forget to post it?
Hurruwa
HurruwaOPβ€’8mo ago
Sorry forgot to attach the image: Thanks in advance @PovilasKorop πŸ˜‰
No description
Hurruwa
HurruwaOPβ€’8mo ago
Im also following the ->registerActions() steps from the docs and im able to render de action but it does nothing. Docs im following: https://filamentphp.com/docs/3.x/infolists/actions#adding-an-action-to-a-custom-infolist-component This is my new code for that: Infolist Schema:
ActionListEntry::make('actions')
->registerActions([
Action::make('viewAction')
->iconButton()
->icon('heroicon-o-eye')
->modalHeading('View Action')
->modalDescription('View the activity details.')
->slideOver()
->modalWidth('xl')
->action(fn($record) => dd($record)),
//->modalContent(fn($record) => view('filament.pages.view-activity' , ['activity' => $record])),
])
ActionListEntry::make('actions')
->registerActions([
Action::make('viewAction')
->iconButton()
->icon('heroicon-o-eye')
->modalHeading('View Action')
->modalDescription('View the activity details.')
->slideOver()
->modalWidth('xl')
->action(fn($record) => dd($record)),
//->modalContent(fn($record) => view('filament.pages.view-activity' , ['activity' => $record])),
])
Blade view
{{ $getAction('viewAction') }}
{{ $getAction('viewAction') }}
Want results from more Discord servers?
Add your server