PHP code example of tangjun / operation-log

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

    

tangjun / operation-log example snippets


    'providers' => [
        // ...
        TangJun\SysAuditLog\SysAuditLogServiceProvider::class,
    ]

    'aliases' => [
        // ...
        'SysAuditLog' => TangJun\SysAuditLog\Facades\SysAuditLogFacade::class,
    ]

	//填写要记录的日志的模型名称
	return [
	    'entities'=>
            [
		        '\App\Models\Users',
	        ]
    ];



update

$users = Users::find(1);
$users->name = "myname";
$users->save();

add

$users = new Users();
$users->name = "myname";
$users->save()

delete

Users:destroy(1);



use SysAuditLog

SysAuditLog::createActionLog(Array $data,$action);

$ php artisan vendor:publish
$ php artisan migrate