Tooltip on Enums?
Hi!
Trying to add a tooltip to a (table) TextColumn.
namespace App\Enums;
use ...
use ...
use ...
enum TicketPriority: string implements HasLabel, HasColor, HasIcon
{
case Low = 'low';
case Medium = 'medium';
case High = 'high';
case Urgent = 'urgent';
.....
public function getTooltip(): ?string
{
return match ($this) {
self::Low => ('Longer description 1 here ....'),
self::Medium => ('Longer description 2 here ....'),
self::High => ('Longer description 3 here ....'),
self::Urgent => ('Longer description 4 here ....'),
};
}
....
Trying to add a tooltip to a (table) TextColumn.
- My Enum looks like this:
namespace App\Enums;
use ...
use ...
use ...
enum TicketPriority: string implements HasLabel, HasColor, HasIcon
{
case Low = 'low';
case Medium = 'medium';
case High = 'high';
case Urgent = 'urgent';
.....
public function getTooltip(): ?string
{
return match ($this) {
self::Low => ('Longer description 1 here ....'),
self::Medium => ('Longer description 2 here ....'),
self::High => ('Longer description 3 here ....'),
self::Urgent => ('Longer description 4 here ....'),
};
}
....
- On my resource im trying to get:... IconColumn::make('priority') ->label('') //-narrower column ->icon(fn($state) => $state->getIcon()) //-Picks and shows the icon ->size(IconColumnSize::Medium) ->tooltip(fn($state) => $state->getTooltip()),...
- I get the following error:
- However, if I do something like this:...IconColumn::make('priority') ->label('') ->icon(fn($state) => $state->getIcon()) ->size(IconColumnSize::Medium) ->tooltip(fn($state) => dd($state->getTooltip())), <------------ ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ...
- I actually get: "Longer description 1 here ...." // app/Filament/Resources/TicketResource.php:116
- What am I missing??Thanks!!!!