What are accessor and mutator in laravel?

Posted by Andre Scott | Updated on

In the Laravel, mutators and accessors allow you to alter data before it’s saved to and fetched from a database. To be specific, the mutator allows you to alter data before it’s saved to a database.

On the other hand, the accessor allows you to alter data after it’s fetched from a database.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers