robmellett/laravel-model-history

A simple trait to add to your models so you can store CREATED and UPDATED differences


README

Track model history

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This little package will create a history_events table, so that you can track model Created and Updated events, along with the data changing between updates.

Installation

You can install the package via composer:

composer require robmellett/laravel-model-history

You can publish and run the migrations with:

php artisan vendor:publish --tag="model-history-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="model-history-config"

This is the contents of the published config file:

return [
];

Usage

You can add the Historize trait to your model, and the CREATED and UPDATED events will be fired when the model is created and updated.

class Product extends Model
{
    use Historize;
}

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.