Accessor Archives

Accessor and Mutators in Laravel

Author - Webner

Accessor and Mutators are allowed to alter the data before saving and fetching from the database. An accessor is used to change the format while fetching the data from the database and mutators set the format attributes before retrieving the data from the database.

Why do we need this Read more…