<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
oneseven9955 / laravel-auditing-filesystem example snippets
// ...
'drivers' => [
'database' => [
'table' => 'audits',
'connection' => null,
],
'filesystem' => [
'disk' => 'local', // The registered name of any filesystem disk in the application
'dir' => 'audit', // The directory on the disk where the audit csv files will be saved
'filename' => 'audit.csv', // The filename of the audit file
'rotation' => 'single', // One of 'single', 'daily', or 'hourly'
],
],
// ...
namespace App\Models;
use OneSeven9955\Auditing\Drivers\FilesystemDriver;
use Illuminate\Database\Eloquent\Model;
use OwenIt\Auditing\Contracts\Auditable;
class Article extends Model implements Auditable
{
use \OwenIt\Auditing\Auditable;
/**
* Filesystem Audit Driver.
*
* @var \OneSeven9955\Auditing\Drivers\FilesystemDriver
*/
protected $auditDriver = FilesystemDriver::class;
// ...
}
use OneSeven9955\Auditing\Drivers\FilesystemDriver;
app(FilesystemDriver::class)->bufferStart();
// ...
// PERFORM MODEL CHANGES
// ...
app(FilesystemDriver::class)->bufferFlush(); // flush all audit records into a file at once
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.