© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
8 replies
tjodalv

ViewAction on resource's table listing page

Hi,
I have a model Estimate that has relationship to other model User. I want from ListEstimate page to have action that will open user info in a modal window (slideover). How to achive that? What I tried so far didn't work:

Tables\Actions\ViewAction::make('view-user')
  ->label('Show user')
  ->slideOver(true)
  ->record(fn ($record) => User::find($record->user_id));
Tables\Actions\ViewAction::make('view-user')
  ->label('Show user')
  ->slideOver(true)
  ->record(fn ($record) => User::find($record->user_id));
Solution
I've manage to find the solution to my problem using
mountUsing()
mountUsing()
method on an action by inspecting how ViewAction works in the Filament. This is my solution:

Tables\Actions\Action::make('view-linked-user')
  ->label('Show user')
  ->slideOver(true)
  ->mountUsing(function (Form $form, Estimate $record) {
      $user = User::find($record->user_id);
      $form->model($user);
      $form->operation('view');
      $form->disabled(true);
      $form->fill($user->toArray());
  })
  ->form(function (Estimate $record): array {
      return [...UserForm::fields()];
  });
Tables\Actions\Action::make('view-linked-user')
  ->label('Show user')
  ->slideOver(true)
  ->mountUsing(function (Form $form, Estimate $record) {
      $user = User::find($record->user_id);
      $form->model($user);
      $form->operation('view');
      $form->disabled(true);
      $form->fill($user->toArray());
  })
  ->form(function (Estimate $record): array {
      return [...UserForm::fields()];
  });


In my
form()
form()
method I am calling my custom class
UserForm
UserForm
that define fields for this action and for my
UserResource
UserResource
class.
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
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

ViewAction on custom page
FilamentFFilament / ❓┊help
3y ago
Table on resource edit page?
FilamentFFilament / ❓┊help
3y ago
Custom table on resource edit page
FilamentFFilament / ❓┊help
2y ago
Listing in Resource
FilamentFFilament / ❓┊help
2y ago