PHP code example of eddytim / auditlog

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

    

eddytim / auditlog example snippets


return [
    'send_email_to'   => '',
    'user_model' => App\Models\User::class,
    'foreign_key' => 'user_id',
    'owner_key' => 'id',
    'audit_logs_limit' => 50,
];

    'providers' => [
        // ...
        'Eddytim\Auditlog\AuditLogServiceProvider',
    ]

    'providers' => [
        // ...
        \Eddytim\Auditlog\AuditLogServiceProvider::class,
    ]

    $log = AuditLog::store([
            'event_status' => 'SUCCESS',
            'event_type' => 'Update',
            'user_id' => Auth::id(),
            'description' => 'Changing user name from (old value) to (new value)',
            'table_name' => null, // insert a table name if you will want to track affected table
            'row_id' => null // insert table row id if you will want to track specific affected record
        ]);

// Make sure you have your mail configured and published the vendor so as to specify an email address
    $log = AuditLog::store([
            'event_status' => 'SUCCESS',
            'event_type' => 'Update',
            'user_id' => Auth::id(),
            'description' => 'Changing user name from (old value) to (new value)',
            'table_name' => null, // insert a table name if you will want to track affected table
            'row_id' => null // insert table row id if you will want to track specific affected record
        ], 'This is a message to alert you on the changes');


//    Parameter param $offset
     */
    $logs = AuditLog::getAuditLogs(0);
$ php artisan vendor:publish --provider="Eddytim\Auditlog\AuditLogServiceProvider"