Hide Actions on RelationManager

I am using ExampleResource::table($table) in a RelationManager. This includes all the actions that appear on that resource's table. When I call ->actions() to add a "DetachAction", this is added correctly. However, I would like a way of removing existing actions or resetting them. I tried the hiddenOn() behaviour that is available for table columns. Is this possible for actions?
Solution:
AH! My current branch is on an old version of Filament (Laravel 9, due to Nova). It appears this behaviour has been changed to how I expected it, in the latest version (different branch). Perfect!
Jump to solution
6 Replies
trovster
trovsterOP6mo ago
Does anyone know if it is possible to remove actions from a table listing?
LeandroFerreira
LeandroFerreira6mo ago
you can override the actions
ExampleResource::table($table)
->actions([
Tables\Actions\DetachAction::make(),
Tables\Actions\DeleteAction::make(),
])
ExampleResource::table($table)
->actions([
Tables\Actions\DetachAction::make(),
Tables\Actions\DeleteAction::make(),
])
trovster
trovsterOP6mo ago
@Leandro Ferreira This does not override them, this adds to them…
toeknee
toeknee6mo ago
It shouldn't can you provide all code please
Solution
trovster
trovster6mo ago
AH! My current branch is on an old version of Filament (Laravel 9, due to Nova). It appears this behaviour has been changed to how I expected it, in the latest version (different branch). Perfect!
trovster
trovsterOP6mo ago
Thanks for the debugging. I should've tested with my newer branch.

Did you find this page helpful?