F
Filamentβ€’2mo 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β€’2mo ago
Wrap them with an ActionGroup?
Dennis Koch
Dennis Kochβ€’2mo ago
But yeah it needs to be done manually in all the places probably
rabol
rabolβ€’2mo 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
rabolβ€’2mo ago
No description
Dennis Koch
Dennis Kochβ€’2mo ago
Try Impersonate::make()->label('Impersonate')->grouped(),
rabol
rabolβ€’2mo ago
the rest is perfect, thanks
rabol
rabolβ€’2mo ago
No description
rabol
rabolβ€’2mo ago
better but it lost the colors πŸ™‚ not a big deal
Dennis Koch
Dennis Kochβ€’2mo ago
Try adding ->color() again
rabol
rabolβ€’2mo ago
cool, thanks a lot!
Want results from more Discord servers?
Add your server