79302656

Date: 2024-12-23 09:20:51
Score: 2
Natty:
Report link

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.

Reasons:
  • Blacklisted phrase (0.5): how can i
  • RegEx Blacklisted phrase (1): I want
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: Karan Datwani