© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
cakan

Action not working in custom view

I have a custom page with action defined like this:
public function downloadBookAction(): Action
{
    return Action::make('downloadBook')
        ->action(function (array $arguments) {
            $this->book = Book::findOrFail($arguments['id']);
            return Storage::disk('public')->download($this->book['file']);
        });
}
public function downloadBookAction(): Action
{
    return Action::make('downloadBook')
        ->action(function (array $arguments) {
            $this->book = Book::findOrFail($arguments['id']);
            return Storage::disk('public')->download($this->book['file']);
        });
}

In blade for my custom view I have this line
{{ ($this->downloadBookAction)(['id'=>$book->id]) }}
{{ ($this->downloadBookAction)(['id'=>$book->id]) }}

This works as expected and clicking on a button starts file download.

Later, on same custom page I have a modal dialog with Book details this modal uses another custom view:
View::make('bookDetails')->model(fn () => $this->book)->view('filament.resources.book-resource.pages.actions.book-details')
View::make('bookDetails')->model(fn () => $this->book)->view('filament.resources.book-resource.pages.actions.book-details')

But here the action defined in my custom page doesn't work. Code recognizes the downloadBookAction and the button is displayed with all formatting, icon, etc. but when I click on the button, nothing happens - it never gets into the
->action()
->action()
method.

What am I doing wrong?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Custom action not working
FilamentFFilament / ❓┊help
3y ago
Custom action buttons not working in production
FilamentFFilament / ❓┊help
3y ago
Use Action in custom ViewRecord page
FilamentFFilament / ❓┊help
3y ago
custom view in a header action possible?
FilamentFFilament / ❓┊help
3y ago