F
Filamentβ€’5mo ago
rabol

How to get row actions as a menu instead of links

Hi Is there an easy way to 'group' all row actions into a 'drop-down'?
Solution:
Wrap them with an ActionGroup?
Jump to solution
10 Replies
Solution
Dennis Koch
Dennis Kochβ€’5mo ago
Wrap them with an ActionGroup?
Dennis Koch
Dennis Kochβ€’5mo ago
But yeah it needs to be done manually in all the places probably
rabol
rabolOPβ€’5mo ago
Aha... I'll try the ActionGroup, thanks ok.... I got the drodown, but... I have this:
$table->actions([
Tables\Actions\ActionGroup::make([
Tables\Actions\EditAction::make(),
Impersonate::make()->label('Impersonate'),
Tables\Actions\Action::make('details')
->url(static fn (User $record): string => UserResource::getUrl('details', ['record' => $record]))
->icon('heroicon-o-identification'),
Tables\Actions\Action::make('inviteUser')
->label('Invite')
->tooltip('Invite user')
->icon('heroicon-o-user-plus')
->requiresConfirmation()
->action(fn (User $record) => UserResource::inviteUser($record)),

Tables\Actions\DeleteAction::make('delete'),
]),
]);
$table->actions([
Tables\Actions\ActionGroup::make([
Tables\Actions\EditAction::make(),
Impersonate::make()->label('Impersonate'),
Tables\Actions\Action::make('details')
->url(static fn (User $record): string => UserResource::getUrl('details', ['record' => $record]))
->icon('heroicon-o-identification'),
Tables\Actions\Action::make('inviteUser')
->label('Invite')
->tooltip('Invite user')
->icon('heroicon-o-user-plus')
->requiresConfirmation()
->action(fn (User $record) => UserResource::inviteUser($record)),

Tables\Actions\DeleteAction::make('delete'),
]),
]);
Looks like the imperonate plugin in does not follow the rulese
rabol
rabolOPβ€’5mo ago
No description
Dennis Koch
Dennis Kochβ€’5mo ago
Try Impersonate::make()->label('Impersonate')->grouped(),
rabol
rabolOPβ€’5mo ago
the rest is perfect, thanks
rabol
rabolOPβ€’5mo ago
No description
rabol
rabolOPβ€’5mo ago
better but it lost the colors πŸ™‚ not a big deal
Dennis Koch
Dennis Kochβ€’5mo ago
Try adding ->color() again
rabol
rabolOPβ€’5mo ago
cool, thanks a lot!
Want results from more Discord servers?
Add your server