In Laravel 5.7 in my database I have a property containing a number in its name - item_1_quality. When I create an accessor with method name using camel case it is ignored.
I have tried various combinations the most obvious of which was
public function getItem1QualityAttribute($value)
{
dd($value);
}
however, it does not work. I tried other possible combinations without success. I am properly calling the property as other accessors in the same model work fine. The problem seems to be related to the naming.
I have found a hacky but a working solution which someone might find helpful.
Add attribute to appends
Create the following accessor:
The $value as argument will not work - access using the $attributes array.