Sometimes need to modify a field value while retrieving records using Laravel Eloquent e.g. get date from datetime field, make field value in upper case, etc.
To do that you can either use selectRaw()
or Accessors.
Similarly, If you want to update the value while inserting or updating using Eloquent then you can either modify value every time before storing or use Mutators.
In this tutorial, I show how you can use Accessors And Mutators in the Laravel 9 project.