custom page action not opening

I have a custom page for a resource trying to add an action at the end of the form adding it to getHeaderActions work fine but not as asepreate action even adding <x-filament-actions::modals /> no effect not sure what i am missing! my Page:
protected function getHeaderActions(): array
{
// this dose ork
return [
Action::make('get-link-head')
->requiresConfirmation()
->action(function () {
dd(9);
}),
];
}

public function getLinkAction(): Action
{
// this dose not work
return Action::make('get-link')
->requiresConfirmation()
->action(function () {
dd(9);
});
}
protected function getHeaderActions(): array
{
// this dose ork
return [
Action::make('get-link-head')
->requiresConfirmation()
->action(function () {
dd(9);
}),
];
}

public function getLinkAction(): Action
{
// this dose not work
return Action::make('get-link')
->requiresConfirmation()
->action(function () {
dd(9);
});
}
view:
<x-filament-panels::page>
<x-filament-panels::form>
<div>
{{ $this->form }}
</div>

<div class="text-center">
{{ $this->getLinkAction }}
<x-filament-actions::modals />
</div>
</x-filament-panels::form>
</x-filament-panels::page>
<x-filament-panels::page>
<x-filament-panels::form>
<div>
{{ $this->form }}
</div>

<div class="text-center">
{{ $this->getLinkAction }}
<x-filament-actions::modals />
</div>
</x-filament-panels::form>
</x-filament-panels::page>
Solution:
Heh I had similar issues with custom actions. Super-dumb, but can you rename Action::make('get-link') to Action::make('getLink') ?
Jump to solution
16 Replies
Solution
ChesterS
ChesterS13mo ago
Heh I had similar issues with custom actions. Super-dumb, but can you rename Action::make('get-link') to Action::make('getLink') ?
ChesterS
ChesterS13mo ago
Also unrelated but what is that sidebar with the updates?
Lara Zeus
Lara ZeusOP13mo ago
WHHHHAT 🤯 thanks for the help haha never thought of that could be the reason and the sidebar is the devtools in chrome 🙂 on the network tab
ChesterS
ChesterS13mo ago
Ah ok I thought it was an extension or something
Lara Zeus
Lara ZeusOP13mo ago
nah 🙂
Wiebe
Wiebe12mo ago
ive got the same problem, but changing it to snakeCase doesnt help
Lara Zeus
Lara ZeusOP12mo ago
did you add <x-filament-actions::modals /> to your component?
Wiebe
Wiebe12mo ago
yes
Lara Zeus
Lara ZeusOP12mo ago
any errors in the devtool console?
Wiebe
Wiebe12mo ago
nope
Lara Zeus
Lara ZeusOP12mo ago
then without code idk 😅
Wiebe
Wiebe12mo ago
lol if i name the method "renderAction" it doesnt work public function renderAction(): Action { return Action::make('delete') ->requiresConfirmation() ->action(fn () => $this->post->delete()); }
Lara Zeus
Lara ZeusOP12mo ago
now we talking haha the id and the function name has to be the same make('render')
ralphjsmit
ralphjsmit12mo ago
Thanks so much, this helped for me as well 🫠 Super weird quirk.
jaocero
jaocero12mo ago
This is what I also discover 2 weeks ago ahahaha so I put a note so that I can remember how to name an Action haha
No description
Want results from more Discord servers?
Add your server