PHPackages                             remyb98/object-tracker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. remyb98/object-tracker

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

remyb98/object-tracker
======================

Track changes on objects

v1.1.0(2mo ago)128MITPHPPHP ^8.4

Since Nov 22Pushed 2mo agoCompare

[ Source](https://github.com/Remyb98/object-tracker)[ Packagist](https://packagist.org/packages/remyb98/object-tracker)[ RSS](/packages/remyb98-object-tracker/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Object tracker
==============

[](#object-tracker)

**Object tracker** is a PHP **trait** that allows you to track changes in a class.
It captures the initial state of an object and detects modifications on properties annotated with the `#[Track]` attribute.

Features
--------

[](#features)

- Track changes in object properties
- Supports PHP 8+ attributes
- Use aliases or a display property for objects
- `commit()` function to update the snapshot

Installation
------------

[](#installation)

Install via Composer:

```
composer require remyb98/object-tracker
```

Usage
-----

[](#usage)

### Declare a class

[](#declare-a-class)

Use the Trackable trait in your class:

```
