fsi/property-observer
DEPRECATED: This package will not receive updates and may be removed. FSi PropertyObserver tracks changes in registered object properties so you can detect if a value changed since the last check.
Model::getOriginal() or Model::fireModelEvent() may suffice for Eloquent models, reducing the need for this package.symfony/property-info in Laravel 9+). This introduces versioning and compatibility risks, especially in modern Laravel stacks.laravel-model-dirty or Model::getOriginal() are lower-risk.saveValue()/clear() calls, which may not align with Laravel’s reactive patterns (e.g., automatic change detection via observers or events).AppServiceProvider).symfony/property-access).Model::getOriginal(), replicas, or Observers) may offer similar functionality with lower risk and better maintainability.Model::getOriginal()?symfony/property-access v2.x).symfony/property-access (v2.x): Outdated and may conflict with Laravel’s symfony/property-info (v5.x+).Model::getOriginal($attribute) or Model::replicate().__get()/__set() with manual state tracking or use Laravel Events for change notifications.PropertyObserver/MultiplePropertyObserver. Prioritize high-impact areas (e.g., audit logging, optimistic locking).getOriginal() or snapshots.ChangeTracker class storing original values in a static or private property).class PropertyChangeTracker
{
public function trackChanges(object $object, string|array $properties): void
{
$observer = new \FSi\Component\PropertyObserver\MultiplePropertyObserver();
$observer->saveValues($object, (array)$properties);
// Trigger events/jobs on changes
}
}
symfony/property-access to a specific version in composer.json to avoid surprises.
"symfony/property-access": "2.3.0"
symfony/property-access).spatie/laravel-activitylog or league/observer.laravel-model-dirty or laravel-observables.symfony/property-info).Log::warning("Using deprecated PropertyObserver")).class UserDTO {
private string $originalEmail;
public function __construct(public string $email) {
$this->originalEmail = $email;
}
public function hasEmailChanged(): bool {
return $this->email !== $this->originalEmail;
}
}
symfony/property-access.symfony/property-access).symfony/property-access may introduce vulnerabilities or compatibility issues.ChangeTracker service) to avoid dependency risks.symfony/property-access under the hood).clear() may be necessary frequently).clear() calls.How can I help you explore Laravel packages today?