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/ */
$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');