ascend/laravel-column-watcher
Attribute-based “column watchers” for Laravel Eloquent models. Trigger handlers only when specific attributes change (before/after save), with support for multiple watchers, queueable handlers, events, and Octane compatibility—avoiding bulky, monolithic model observers.
status updates to "shipped," or validating price adjustments in real-time).user.roles).order.status) change.inventory.quantity can’t exceed max_stock).user.email_verified changes).Adopt When:
Observer logic for column-specific actions.price updates, not all model changes").Look Elsewhere If:
Observers or Model::saved().Form Requests or Policy classes).For Executives:
"This package lets us react to specific data changes—like a customer updating their status—without writing clunky, repetitive code. It’s like setting up automated alerts or actions for critical fields, reducing bugs and speeding up development. For example, we could auto-send a welcome email when a user’s is_active flag flips to true, all without touching the model directly. It’s scalable, maintainable, and cuts down on technical debt."
For Engineers: *"Laravel Column Watcher replaces verbose Observers with clean, attribute-based column listeners. Key benefits:
Observer classes for simple column reactions.user.last_login).Perfect for audit logs, notifications, or workflow triggers—just annotate your model and go."*
For Developers: *"Imagine this:
#[Watch(columns: 'status', timing: self::AFTER_SAVE)]
public function handleStatusChange(ColumnChange $change) {
if ($change->newValue === 'shipped') {
Notification::send($change->model, new OrderShipped());
}
}
No more Observer classes or hacky saved() listeners. Try it for your next feature—it’s a game-changer for column-specific logic."*
How can I help you explore Laravel packages today?