nikus
nikus
Explore posts from servers
FFilament
Created by nikus on 8/29/2023 in #❓┊help
[ Issue ] Enum Casting on Eloquent ORM
Hello fellas, Can anyone let me know when a Eloquent Model has an enum caster ( It doesnt matter if its spatie package backed or PHP Native ones ) i always get the following error when trying to open forms/pages Property type not supported in Livewire for property: ["bar"] Being "bar" the actual value of the enum. The current workaround i have found was to implement a Wireable to the enum, but to me it feels dirty.
<?php

namespace App\Enum;

use Livewire\Wireable;

enum TypeEnum: string implements Wireable
{
case Foo = 'foo';
case Bar = 'bar';

// ... Wireable methods...
}
<?php

namespace App\Enum;

use Livewire\Wireable;

enum TypeEnum: string implements Wireable
{
case Foo = 'foo';
case Bar = 'bar';

// ... Wireable methods...
}
To me its seems like Livewire / Filament doesnt know how to "transpile" this types directly? Version: 3.0.0-beta.9
12 replies