PHP code example of laravel-enso / audit

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

    

laravel-enso / audit example snippets


namespace App\Providers;

use App\Models\Invoice;
use LaravelEnso\Audit\AuditServiceProvider as ServiceProvider;

class AuditServiceProvider extends ServiceProvider
{
    public $models = [
        Invoice::class,
    ];
}

use Illuminate\Database\Eloquent\Model;

class Invoice extends Model
{
    public function auditableAttributes(): array
    {
        return ['status', 'total'];
    }
}
bash
php artisan migrate