PHP code example of ensi / laravel-auditing

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

    

ensi / laravel-auditing example snippets


use Ensi\LaravelAuditing\Contracts\Auditable;
use Ensi\LaravelAuditing\SupportsAudit;

class Something extends Model implements Auditable {
    use SupportsAudit;
}


DB::transaction(function () {
    Transaction::setRootEntity($rootModel);
    
    $relatedModel->save();
});

Subject::attach($subject); // $subject - объект реализующий Ensi\LaravelAuditing\Contracts