Laravel Eloquent only()
Laravel Eloquent Attributes

When dealing with an Eloquent model, you can add your own attributes. These can be useful for computed values.

For example:

Just remember that when creating an attribute, you start with get and end with  Attribute, and the name goes in the middle. The whole thing is camelCase. This is Laravel’s convention.