PHP code example of mintbridge / eloquent-auditing

1. Go to this page and download the library: Download mintbridge/eloquent-auditing 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/ */

    

mintbridge / eloquent-auditing example snippets


// config/app.php

'providers' => [
    '...',
    Mintbridge\EloquentAuditing\AuditServiceProvider::class,
];

'aliases' => [
    ...
    'Auditor' => Mintbridge\EloquentAuditing\AuditorFacade::class,
];

use Mintbridge\EloquentAuditing\Auditable;
use Mintbridge\EloquentAuditing\AuditableInterface;

class Article extends Eloquent implements AuditableInterface {

    use Auditable;
...

use Mintbridge\EloquentAuditing\Auditable;
use Mintbridge\EloquentAuditing\AuditableInterface;

class Article extends Eloquent implements AuditableInterface {

    use Auditable;

    public static $auditableEvents = [
        'creating',
        'created',
        'updating',
        //...
    ];
...

php artisan vendor:publish --provider="Mintbridge\EloquentAuditing\AuditServiceProvider" --tag="config"
php artisan vendor:publish --provider="Mintbridge\EloquentAuditing\AuditServiceProvider" --tag="migrations"
php artisan migrate
config/auditing.php
config/auditing.php