A guide to custom model casts in Laravel
Model casts, mutators, and accessors are something you work with a lot when building Laravel applications. They play an essential role in how you interact with your models and their underlying data. Laravel ships with a variety of handy, built-in casts which cover the majority of your use cases. But there may be times when you need to create your own custom casts to handle storing and retrieving data in a specific way.