F
Filament10mo ago
Iztok

Edit action in getHeaderActions

I used to be able to simply do this on Resource view page (or any other Resource page):
protected function getHeaderActions(): array
{
return [
ViewAction::make(),
EditAction::make(),
DeleteAction::make()
];
}
protected function getHeaderActions(): array
{
return [
ViewAction::make(),
EditAction::make(),
DeleteAction::make()
];
}
But after the update the edit link opens an empty modal, so I have to specify the url like this:
{
return [
ViewAction::make(),
EditAction::make()
->url(fn ($record): string => PhantomInstanceResource::getUrl('edit', ['record' => $record])),
DeleteAction::make()
];
}
{
return [
ViewAction::make(),
EditAction::make()
->url(fn ($record): string => PhantomInstanceResource::getUrl('edit', ['record' => $record])),
DeleteAction::make()
];
}
Is there any way to define the default edit action in the resource definition?
1 Reply
Dennis Koch
Dennis Koch10mo ago
I think the default is set by the ListPages. So if you use it on a different page you need to do this yourself.
Want results from more Discord servers?
Add your server