F
Filament7mo 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 Koch7mo ago
Wrap them with an ActionGroup?
Dennis Koch
Dennis Koch7mo ago
But yeah it needs to be done manually in all the places probably
rabol
rabolOP7mo 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
rabolOP7mo ago
No description
Dennis Koch
Dennis Koch7mo ago
Try Impersonate::make()->label('Impersonate')->grouped(),
rabol
rabolOP7mo ago
the rest is perfect, thanks
rabol
rabolOP7mo ago
No description
rabol
rabolOP7mo ago
better but it lost the colors 🙂 not a big deal
Dennis Koch
Dennis Koch7mo ago
Try adding ->color() again
rabol
rabolOP7mo ago
cool, thanks a lot!

Did you find this page helpful?