compoships
compoships copied to clipboard
Error when using a column for which the model specifies cast to Enum
enum MyModelType: string
{
case ....
class MyModel extends Model{
...
protected $casts = [
'type' => MyModelType::class,
];
public function anotherModels(): HasMany
{
return $this->hasMany(AnotherModel::class, ['some_field', 'type'], ['some_field', 'type']);
}
....
Object of class MyModelType could not be converted to string
feel free to make a PR with tests