PHP code example of locksyk / audit-trail-bundle
1. Go to this page and download the library: Download locksyk/audit-trail-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/ */
locksyk / audit-trail-bundle example snippets
final class Thing implements AuditSubjectInterface
{
public function getAuditSubjectId(): string { /* uuid */ }
public function getAuditSubjectParts(): array { return ['name' => $this->name]; }
}
// Your entry persistence (actor, associations):
final class MyEntryWriter implements AuditEntryWriterInterface { /* ... */ }
// In a console command (scoped; restores the previous actor even
// when the callback throws):
$this->actorContext->withActor(ActorRef::human($email), fn () => $this->import($doc));