Once you start diving into the Laravel documentation you’ll find a lot of features that aren’t much talked about in the docs. There are a lot of powerful and easy to use features available, that not everybody is aware of.
This is what a custom cast type that handles JSON could look like: You can attach the custom cast type to a model attribute by using the class name of the custom cast type.
The downside of this method is that you can’t customize the column names.
You can use the second parameter of the increment method to change the amount the value gets incremented by.