What are Accessors and Mutators in Eloquent and why should you use them?

devquora
devquora

Posted On: Jun 16, 2021

 

Accessors and Mutators are the Eloquent Attributes. Accessors are used to format the attributes when you retrieve them from the database. Whereas Mutators are used to format the attributes before saving them into the database.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Laravel Latest Questions

    Explain what is Laravel

    Laravel is an open-source and free PHP framework. This means that this framework can be used for any purpose and the users can study it and modify or make changes in it as well. It is a web framework ...

    Laravel Latest Questions

    How do I install Laravel, talk about the different ways?

    You can download laravel by first downloading the Laravel installer using Composer: composer global requires "laravel/installer=~1.1" then place the ~/.composer/vendor/bin directory in your PATH so th...

    Laravel Latest Questions

    Explain what is MVC architecture?

    MVC architecture stands for Model-View-Controller architecture which is an architectural pattern that separates an application into three main logical components: the model, the view, and the controll...