Skip to content

gupalo/auditlog-bundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AuditLog Bundle

Install

composer require gupalo/auditlog-bundle

Add to config/bundles.php

Gupalo\AuditLogBundle\AuditLogBundle::class => ['all' => true]

Add to config/packages/doctrine.yaml

mappings:
    AuditLogBundle:
        type: attribute

Add to config/routes/annotations.yaml

auditLog:
    resource: '@AuditLogBundle/Resources/config/routes.yaml'

Execute

php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate
php bin/console assets:install

Usage

Audit entity must implements

Gupalo\AuditLogBundle\Entity\AwareAuditLogInterface

For log audit add dispatch

List:

$this->dispatcher->dispatch(new ListEvent(new AwareAuditLogInterfaceEntity()));

View

$this->dispatcher->dispatch(new ViewEvent($entity));

Create

$this->dispatcher->dispatch(new CreateEvent($entity));

Restore

$this->dispatcher->dispatch(new RestoreEvent($entity));

Archive

$this->dispatcher->dispatch(new ArchiveEvent($entity));

Export

$this->dispatcher->dispatch(new ExportEvent($entity));

base route - /audit-log

About

Log user logins and sensitive actions

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •