This article will explain the different ways to automatically manipulate and mutate eloquent model attributes while accessing or retrieving them.
There are many times when it’s necessary to do computations or add extra attributes based on existing attributes on an eloquent model.
An excellent example of this could be concatenating the first name (first_name) and last name (last_name) of the user to form a new computed attribute called name that didn’t exist on our model in the first place.

Another example could be prepending the host/app URL that points to stored files in our database during retrieval.