1. Go to this page and download the library: Download samveloper/auditable library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
samveloper / auditable example snippets
"samveloper/auditable": "1.*",
namespace MyApp\Models;
class Article extends Eloquent {
use \Samveloper\Auditable\AuditableTrait;
public static function boot()
{
parent::boot();
}
}
use Samveloper\Auditable\Auditable;
namespace MyApp\Models;
class Article extends Auditable { }
namespace MyApp\Models;
class Article extends Eloquent {
use Samveloper\Auditable\AuditableTrait;
protected $auditEnabled = false;
}
namespace MyApp\Models;
class Article extends Eloquent {
use Samveloper\Auditable\AuditableTrait;
protected $auditEnabled = true;
protected $historyLimit = 500; //Stop tracking audits after 500 changes have been made.
}
namespace MyApp\Models;
class Article extends Eloquent {
use Samveloper\Auditable\AuditableTrait;
protected $auditEnabled = true;
protected $auditCleanup = true; //Remove old audits (works only when used with $historyLimit)
protected $historyLimit = 500; //Maintain a maximum of 500 changes at any point of time, while cleaning up old audits.
}