Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Computed Attributes Laravel Package

korridor/laravel-computed-attributes

Adds “computed attributes” to Laravel models, letting you define dynamic/derived properties that behave like normal attributes (including access/casting/serialization) without storing them in the database. Useful for clean model APIs and reusable calculations.

View on GitHub
Deep Wiki
Context7
3.3.0

What's Changed

3.2.0
  • Laravel 12 support
  • More type definitions
3.1.0
  • Added Laravel 11 support
  • Added tests for PHP 8.3
  • Added PHPstan (not yet in GitHub actions) and more type documentation
3.0.0

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

  • Laravel 10 support
  • PHP 8.2 support
  • Strict types
  • GitHub Actions
2.2.1
2.2.0

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()).

v2.1.0
  • Added Laravel 9 support
  • Added PHP 8.1 support
  • Updated php-cs-fixer
v2.0.0

What's Changed

  • Added PHP 8 support
  • Removed support for PHP 7.1
  • Added more return types

Full Changelog: https://github.com/korridor/laravel-computed-attributes/compare/v1.0.1...v2.0.0

v1.0.1
  • Added gitattributes file with export-ignores
  • Fixed travis-ci
  • Updated readme and gitignore
v1.0.0

New

  • Added validation command that checks the current values of the given computed attributes (artisan computed-attributes:validate)
  • Added scopes for each command that can be used to alter the query used in the commands (f.e. add ->with('...') for better performance)
  • Added unit tests
  • Added StyleCI, TravisCI and codecov
  • Enhanced readme, Added badges

Fixes

  • Fixed bug in generate command (attribute parsing)
v0.0.3
v0.0.1
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle