Dmitriy
Dmitriy
FFilament
Created by Dmitriy on 2/21/2025 in #❓┊help
TextColumn throwing an exception for the empty ENUM value
@awcodes there is no ->enum() method for the TextColumn class:
Method Filament\Tables\Columns\TextColumn::enum does not exist.
Method Filament\Tables\Columns\TextColumn::enum does not exist.
But I was able to fix the error adding this:
->getStateUsing(fn ($record) => $record->getAttributes()['language'] ? Language::from($record->getAttributes()['language']) : null)
->getStateUsing(fn ($record) => $record->getAttributes()['language'] ? Language::from($record->getAttributes()['language']) : null)
Thank you for your assistance!
12 replies
FFilament
Created by Dmitriy on 2/21/2025 in #❓┊help
TextColumn throwing an exception for the empty ENUM value
Thank you for your reply, I will try playing with ->getStateUsing(). Using the default in the enum for getLabel() didn't help for me. I used such code:
public function getLabel(): string
{
return match ($this) {
self::NL => __('Dutch'),
self::FR => __('French'),
self::EN => __('English'),
default => '',
};
}
public function getLabel(): string
{
return match ($this) {
self::NL => __('Dutch'),
self::FR => __('French'),
self::EN => __('English'),
default => '',
};
}
12 replies
FFilament
Created by Dmitriy on 2/21/2025 in #❓┊help
TextColumn throwing an exception for the empty ENUM value
No description
12 replies