getAttribute not working when i have a number in my column name
Hey guys,
I'm having some trouble with the getAttribute method on a model.
In my database i have the following column names: date_1m, date_6m and date_12m
The problem is that i want to format these items in my model but this isn't working as it should.
This is my function:
public function getDate1mAttribute($value)
{
return is_null($value) ? $value : Carbon::parse($value)->format('d/m/Y');
}
This isn't formatting my date like it should, because the method is never triggered. Can anyone tell me if this is a laravel bug? Or is it just me doing things wrong?