Hide label for action

I'm trying to hide the label of an action and I see that there's a disableLabel method but it doesn't hide the label. When using ->label(false) on the action the label gets hidden but there's an PHPStan warning:
phpstan: Parameter #1 $label of method Filament\Support\Actions\BaseAction::label() expects Closure|Illuminate\Contracts\Support\Htmlable|string|null, false given.
phpstan: Parameter #1 $label of method Filament\Support\Actions\BaseAction::label() expects Closure|Illuminate\Contracts\Support\Htmlable|string|null, false given.
What is the correct way to hide the label of an action?
6 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Daniel
DanielOP2y ago
Dan Harrin
Dan Harrin2y ago
what type of action is it button? icon button? link?
Daniel
DanielOP2y ago
Filament\Tables\Actions
Action::make('edit')
->label('')
->icon('heroicon-o-pencil')
Action::make('edit')
->label('')
->icon('heroicon-o-pencil')
Dan Harrin
Dan Harrin2y ago
so its a link? try ->iconButton() because setting an empty label is not accessible
Daniel
DanielOP2y ago
works like a charme - thanks a lot!!!

Did you find this page helpful?