pozitiveman
pozitiveman
FFilament
Created by pozitiveman on 2/3/2024 in #❓┊help
Enum Class name in Frontend
@awcodes By frontend I mean the response from the server. It feels strange that I see App\\Enums\\EventStatus in the response, which outputs the enum class name and the file path to the end user. My expectation was that it would just cast the value of the enum, without exposing enum class file name. My apologize, I'm still figuring our how all this livewire and filament works.
7 replies
FFilament
Created by pozitiveman on 2/3/2024 in #❓┊help
Enum Class name in Frontend
@Tieme
ToggleButtons::make('type') ->options(EventType::class) ->default(EventType::Standard), Select::make('status') ->options(EventStatus::class) ->default(EventStatus::Published), *I have other parameters for Select and ToggleButton, but non of them made a difference. use Filament\Support\Contracts\HasLabel; enum EventStatus: string implements HasLabel { case Draft = 'draft'; case Published = 'published'; public function getLabel(): ?string { return $this->name; } } * Also adding or excluding HasLabel interface did not make any difference.
7 replies