using AsEnumArrayObject with enums

when I try to use AsEnumArrayObject in casting in my model:
protected $casts = [
'permissions' => AsEnumArrayObject::class.':'.Abilities::class,
];
protected $casts = [
'permissions' => AsEnumArrayObject::class.':'.Abilities::class,
];
in the table: Tables\Columns\TextColumn::make('permissions') I get
htmlspecialchars(): Argument #1 ($string) must be of type string, Illuminate\Database\Eloquent\Casts\ArrayObject given
htmlspecialchars(): Argument #1 ($string) must be of type string, Illuminate\Database\Eloquent\Casts\ArrayObject given
is it even possible to use AsEnumArrayObject with enums in filament? couldent see anything here https://filamentphp.com/docs/3.x/support/enums
1 Reply
Lara Zeus
Lara Zeus11mo ago
I think this is a bug I had to add this to text-column.blade.php
if(is_object($arrayState)){
$arrayState = $arrayState->toArray();
}
if(is_object($arrayState)){
$arrayState = $arrayState->toArray();
}
will do more checks and post it in github