https://github.com/aedart/athenaeum-audit
[READ ONLY] Athenaeum Audit package - see https://github.com/aedart/athenaeum
https://github.com/aedart/athenaeum-audit
Last synced: about 1 year ago
JSON representation
[READ ONLY] Athenaeum Audit package - see https://github.com/aedart/athenaeum
- Host: GitHub
- URL: https://github.com/aedart/athenaeum-audit
- Owner: aedart
- License: bsd-3-clause
- Created: 2021-04-26T06:37:51.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-06-27T07:59:17.000Z (about 1 year ago)
- Last Synced: 2025-06-27T08:41:33.779Z (about 1 year ago)
- Language: PHP
- Size: 116 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Athenaeum Audit
An [audit trail](https://en.wikipedia.org/wiki/Audit_trail) package for Laravel Eloquent Model.
It is able to store the changes made on a given model into an "audit trails" table, along with the attributes that have been changed.
## Example
```php
namespace Acme\Models;
use Illuminate\Database\Eloquent\Model;
use Aedart\Audit\Traits\RecordsChanges;
class Category extends Model
{
use RecordsChanges;
}
```
Later in your application...
```php
$category = Category::create( [ 'name' => 'My category' ]);
// Obtain the "changes" made (in this case a "create" event)
$changes = $category->recordedChanges()->first();
print_r($changes->toArray());
// Example output:
// [
// "id" => 1
// "user_id" => null
// "auditable_type" => "Acme\Models\Category"
// "auditable_id" => "24"
// "type" => "created"
// "message" => "Recording created event"
// "original_data" => null
// "changed_data" => [
// "name" => "My Category"
// "id" => 1
// ]
// "performed_at" => "2021-04-28T11:07:24.000000Z"
// "created_at" => "2021-04-28T11:07:24.000000Z"
// ]
```
## Documentation
Please read the [official documentation](https://aedart.github.io/athenaeum/) for additional information.
## Repository
The mono repository is located at [github.com/aedart/athenaeum](https://github.com/aedart/athenaeum)
## Versioning
This package follows [Semantic Versioning 2.0.0](http://semver.org/)
## License
[BSD-3-Clause](http://spdx.org/licenses/BSD-3-Clause), Read the LICENSE file included in this package