alexstewartja/laravel-attribute-observer
Laravel Attribute Observer lets you react to changes on specific Eloquent model attributes. Define observers for individual fields instead of the whole model, keeping update logic clean, focused, and easy to register in your service provider.
Architecture fit
laravel-attribute-observer is a narrow, single-purpose extension to Eloquent's observer registration: it lets a model declare its observers via PHP 8 attributes instead of (or alongside) the conventional protected static $observers array or Model::observe() calls. It sits entirely inside the application/domain layer — no infrastructure footprint, no queue, cache, or storage dependencies.Integration feasibility
composer require plus package discovery; expected integration cost is measured in hours, not sprints. No data migration, no schema change, no config surface assumed.illuminate/* constraint are unblocked as of 1.8.0.Technical risk
illuminate/support constraint (safe) or by replacing it with a 13-only constraint (silently breaking for anyone on 11/12). This must be verified against the composer.json diff before adoption; a replacement would be a breaking change shipped in a patch/minor.Key questions
composer.json diff widen the illuminate/* constraint or replace it? Does 1.7.x remain installable for Laravel 11/12 consumers?$observers arrays (both mechanisms active, or attribute wins)?Stack fit
Migration path
composer update alexstewartja/laravel-attribute-observer — expected to be a no-op at the code level. No application changes anticipated.observe() calls in providers. Do not convert in bulk; a partial conversion leaves two registration mechanisms live simultaneously, which is acceptable temporarily but must be tracked to completion.Compatibility
composer.json before merging. Confirm the constraint is a union (^11.0|^12.0|^13.0) rather than a 13-only pin.illuminate/*; the Laravel 13 upgrade is a coordinated, multi-package event and this is one dependency in that set.Sequencing
composer.json diff and the CI configuration; confirm constraint widening and a 13 job in the matrix.^1.8.0 on a branch; run the full application test suite (observer behavior is often covered indirectly — verify audit/notification assertions actually exercise the observers).composer.lock.Maintenance
Support
Scaling
Failure modes
$observers entries coexisting during partial migration can fire an observer twice. Verify deduplication behavior before running both mechanisms in production.Ramp-up
How can I help you explore Laravel packages today?