Let's say I have a name field, and I want ucfirst()
on it. I just tested it is working perfectly with the name
text field. CRUD edit form shows the value.
public function getNameAttribute($value)
{
return ucfirst($value);
}
But if it is an Enum field, how can it pre-select the value if it is modified on the fly and differs from the available enum options?
What I can suggest is that you create accessors with different names for your front-end website. So they don't conflict.