I got a model called Run which contains this method:
public function getNameAttribute($name){
if($name == \'Eendaags\')
return $this->race_edition
I was running into an issue with Eloquent accessors and form model binding - by formatting an integer with money_format, the value was no longer being loaded into the form number input field.
The workaround I am using is to create an accessor with a different name:
public function getRevenueDollarsAttribute($value)
{
return money_format('$%i', $this->revenue);
}
This provides me with an accessor without affecting the form model binding.