1. Go to this page and download the library: Download jul6art/audit-bundle 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/ */
jul6art / audit-bundle example snippets
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Jul6Art\CoreBundle\Attribute\Purgeable;
use Jul6Art\CoreBundle\Entity\Traits\IdTrait;
#[ORM\Entity(repositoryClass: AuditLogRepository::class)]
#[ORM\Table(name: 'audit_log')]
#[ORM\Index(columns: ['action'])]
#[ORM\Index(columns: ['created_at'])]
#[Purgeable(field: 'createdAt', interval: '-3 months')]
class AuditLog extends \Jul6Art\AuditBundle\Entity\AuditLog
{
use IdTrait;
}
use Jul6Art\AuditBundle\Attribute\Auditable;
#[ORM\Entity]
#[Auditable]
class Invoice { … }
#[Auditable(onUpdate: false)] // creations and deletions only
#[Auditable(ignoredFields: ['updatedAt', 'viewCount'])] // noise kept out of the diff
class Draft { … }