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(''),
]),


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()
Was this page helpful?