worksome/model-attributes
A Laravel package for defining typed, castable attributes on Eloquent models, cutting casting boilerplate and keeping model data consistent.
getFooAttribute/setFooAttribute methods with declarative PHP attributes on Eloquent models. That is a small but real maintenance cost across a large domain model — relevant if your roadmap includes consolidating legacy models or a schema-heavy rewrite.Consider it when:
#[Cast]-style patterns) and will not need a tutorial to read a model class.Look elsewhere (or wait) when:
Adoption criteria in one line: adopt only on PHP 8.2 / Laravel 10, scoped to a refactor you were already doing, and pin the version.
For executives (one paragraph): This is a small, low-risk developer-ergonomics library for our Laravel codebase. The new release (v0.2.0) is purely a compatibility update — it adds support for PHP 8.2 and Laravel 10 and requires no product changes. Its practical value is that it no longer blocks our planned framework upgrade; the library itself delivers no customer-facing feature, so I am not asking for roadmap time, only noting that it is safe to carry forward. The caveat is that it is pre-1.0 and single-maintainer-ish, so we should pin the version and keep a trivial fallback to plain Laravel accessors.
For engineering leads: v0.2.0 bumps the floor to PHP 8.2 and adds Laravel 10 support; there are no new features, no deprecations, and no API changes called out in the changelog. If you are on Laravel 9 / PHP 8.1, do not take this upgrade — v0.1.0 is now the older, unsupported branch and you should plan the framework bump instead. If you are on Laravel 10, the upgrade is routine. Two first-time contributors landed these PRs, which is a positive maintenance signal but not yet a track record — pin the version in composer.json and avoid spreading the attribute syntax across the whole model layer until the package reaches 1.0 or we have run it in production for a release cycle.
How can I help you explore Laravel packages today?