Download the PHP package isaevdimka/laravel-model-changes-history without Composer
On this page you can find all versions of the php package isaevdimka/laravel-model-changes-history. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download isaevdimka/laravel-model-changes-history
More information about isaevdimka/laravel-model-changes-history
Files in isaevdimka/laravel-model-changes-history
Package laravel-model-changes-history
Short Description Model changes history for laravel
License MIT
Homepage https://github.com/IsaevDimka/laravel-model-changes-history
Informations about the package laravel-model-changes-history
IsaevDimka/laravel-model-changes-history
Records the changes history made to an eloquent model.
Quick start
Your model must have an id
field!
Note: this library use database
storage as default.
Installation
The package is auto discovered.
To change the config, publish it using the following command:
You can use three ways for record changes: 'storage' => 'database', 'file' or 'redis'
If you want to use database
storage, you must publish the migration file, run the following artisan commands:
Use this environment to manage library:
Usage
Add the trait to your model class you want to record changes history for:
Your model now has a relation to all the changes made:
Getting all changes history:
If you use database
storage you can also use morph relations to Change
model:
Clearing changes history:
Get an independent changes history:
Getting model changer:
If you use database
storage you can use Change
model as:
Clearing changes history using console:
You can use it in Kelner
:
All versions of laravel-model-changes-history with dependencies
laravel/framework Version >=5.8
predis/predis Version ^1.1
ext-json Version *