PHP code example of brachiosx / laravel-audit-logger
1. Go to this page and download the library: Download brachiosx/laravel-audit-logger 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/ */
namespace App\Models;
use BrachiosX\AuditLogger\Traits\HasAuditLog;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
class User extends Authenticatable
{
use HasAuditLog, HasApiTokens, HasFactory, Notifiable;
/**
* @var string[]
* field to ignore logging in this model
*/
public array $ignore_auditing = ['created_by'];
/**
* action to disable for audit logging
* values: ['created', 'updated', 'deleted'
*/
public array $ignore_audit_actions = [];
}