PHP code example of greensight / laravel-auditing

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

    

greensight / laravel-auditing example snippets


use Greensight\LaravelAuditing\Contracts\Auditable;
use Greensight\LaravelAuditing\SupportsAudit;

class Something extends Model implements Auditable {
    use SupportsAudit;
}


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

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