You use Eloquent Accessors when you want to get some Model field but transform it to be viewed in some other way. Examples: money formatting, date formatting, some calculated field based on a few other fields.
To create such transformation method in your Model, just create function getFieldAttribute() and then you will access your new field like $model->field.
Read more in the official Laravel docs.
To create such transformation method in your Model, just create function getFieldAttribute() and then you will access your new field like $model->field.
Read more in the official Laravel docs.