korridor/laravel-computed-attributes
A Laravel package for adding computed attributes to Eloquent models. Define derived values from existing model attributes and expose them cleanly alongside database columns, helping keep model logic organized, reusable, and easy to access.
Breaking
The version 3.0.0 is only compatible with Laravel 10. If you want to use this package with an older Laravel version, you can still use the 2.2.* versions. (See README for installation instructions)
Changes
Thanks to a PR from @Onatcer, the command computed-attributes:generate now only saves the model if the recalculated computed property changed the model (checked with $model->isDirty()).
Full Changelog: https://github.com/korridor/laravel-computed-attributes/compare/v1.0.1...v2.0.0
New
artisan computed-attributes:validate)->with('...') for better performance)Fixes
How can I help you explore Laravel packages today?