How to cast properties of array recursively in a Laravel Model
inside my model i have this:
where fields is an array like, stored in database as a json array:
where the type is an integer. this integer is a value from an enum
so i try:
but it doesnt work
also tried:
u know how to achieve it?
also trying to understand it from the docs but not quite getting it - https://laravel.com/docs/10.x/eloquent-mutators#enum-casting
0 Replies