PHP code example of davidiwezulu / audittrail

1. Go to this page and download the library: Download davidiwezulu/audittrail 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/ */

    

davidiwezulu / audittrail example snippets

bash
php artisan vendor:publish --tag=audittrail-migrations
bash
php artisan migrate
bash
php artisan vendor:publish --provider="Davidiwezulu\AuditTrail\AuditTrailServiceProvider" --tag="config"
bash
$post = Post::find(1);
$auditTrails = $post->auditTrails;

foreach ($auditTrails as $audit) {
    echo $audit->event . ': ' . json_encode($audit->new_values) . PHP_EOL;
}