F
Filament15mo ago
Daniel

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 User15mo ago
Message Not Public
Sign In & Join Server To View
Daniel
Daniel15mo ago
Dan Harrin
Dan Harrin15mo ago
what type of action is it button? icon button? link?
Daniel
Daniel15mo ago
Filament\Tables\Actions
Action::make('edit')
->label('')
->icon('heroicon-o-pencil')
Action::make('edit')
->label('')
->icon('heroicon-o-pencil')
Dan Harrin
Dan Harrin15mo ago
so its a link? try ->iconButton() because setting an empty label is not accessible
Daniel
Daniel15mo ago
works like a charme - thanks a lot!!!