ReadOnlyTraitLaravel
ReadOnlyTraitLaravel copied to clipboard
Using native PHP readonly
https://laravel-news.com/php-8-2-0#content-readonly-classes
Looks like PHP introduced readonly classes. Would it make sense to inherit that instead of having custom exceptions? It looks like it only works with dynamic properties not necessarily functions like save. Or you may get unintuitive errors.