Let's get familiar with a few more terms about Eloquent which are Accessors and Mutators or combined, they are called Attributes from Laravel 9.
If you work with projects before Laravel 9, there may be different syntax in older tutorials or examples
Pretty common situation - you have a date field in the MySQL database, which has a default format of YYYY-MM-DD, but the users need to see/edit dates in MM/DD/YYYY. How do you handle it properly in Laravel?
Presenting to you a new Laravel framework feature, released this week by Taylor Otwell himself. You won't need to define getFooAttribute() and setFooAttribute(), instead you define just one foo(). How does it work?