© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
5 replies
BuddhaNature

How can I force a modal to a view when a view page exists.

Hi, I have an action that links to a view page, but I'd also like to have a link to a preview page of that view page as a modal. I am using the following code:

ActionGroup::make([
    ViewAction::make()
        ->slideOver()
        ->modalHeading('Lorem ipsum dolor sit amet, consectetur adipiscing elit.')
        ->modalDescription('Aenean mollis elit eget ullamcorper venenatis.')
        ->label('Preview')
        ->icon(''),
    ViewAction::make()
        ->label('Full View')
        ->icon(''),
]),
ActionGroup::make([
    ViewAction::make()
        ->slideOver()
        ->modalHeading('Lorem ipsum dolor sit amet, consectetur adipiscing elit.')
        ->modalDescription('Aenean mollis elit eget ullamcorper venenatis.')
        ->label('Preview')
        ->icon(''),
    ViewAction::make()
        ->label('Full View')
        ->icon(''),
]),


The second View action works perfectly and links to the view page. But the first View action does not act as a modal and instead links directly to the view page. How can I get the preview link to work as a modal?
Solution
As soon as you have a dedicated page, the ViewAction is configured to link to the page.
You need something like this:

Action::make('preview')
  ->infolist(YourResource::infolist(new Infolist))
  ->slideover()
Action::make('preview')
  ->infolist(YourResource::infolist(new Infolist))
  ->slideover()
Jump to solution
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

how to test a view modal action?
FilamentFFilament / ❓┊help
2y ago
how can redirect to View Page in a Panel?
FilamentFFilament / ❓┊help
2y ago
Rendering custom livewire page on a modal view
FilamentFFilament / ❓┊help
2y ago
how to add field to a view page?
FilamentFFilament / ❓┊help
3y ago