Describe the bug
If a model instance has a property that is casted to an Enum, data binding for this property doesn't work: When loading a form, the element will be empty.
This is likely because the property of the instance is an enum instance, not a string. The correct value can be gotten by accessing $model->enum_property->value.
Have you published the Aire config file?
Yes
Have you added custom Aire views?
No
What version does this affect?
Laravel Version: 9.19.0
Aire Version: 2.5.0
To Reproduce
Steps to reproduce the behavior:
Create a Model with an Enum property (see below)
Create View with a bound input for said property
Create instance of Model
Open an edit view of instance and check the input element for the property
Expected behavior
The input field should be set to the value-property of the Enum-casted property
Describe the bug If a model instance has a property that is casted to an Enum, data binding for this property doesn't work: When loading a form, the element will be empty.
This is likely because the property of the instance is an enum instance, not a string. The correct value can be gotten by accessing
$model->enum_property->value
.Have you published the Aire config file? Yes
Have you added custom Aire views? No
What version does this affect?
To Reproduce Steps to reproduce the behavior:
Expected behavior The input field should be set to the
value
-property of the Enum-casted propertyAdditional context
Example: Model with Enum property
```php EnumProperty::class, ]; } ```Example: Migration for Model
```php id(); $table->string('enum_property'); $table->timestamps(); }); } ```Example: Enum-class
```phpExample: View
```php route('example.update',$example->id) ->bind($example) ->put() ->enctype('multipart/form-data') }} @php $propertySelectList = [ '' => 'Nothing', ]; foreach (EnumProperty::values() as $value) { $propertySelectList[$value] = $value; } @endphp {{ Aire::select($propertySelectList,'enum_property', 'Select Property')}} {{ Aire::submit('Save') }} ```A workaround exists: