PHP code example of majikang / action-log

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

    

majikang / action-log example snippets


    'providers' => [
        majikang\ActionLog\ActionLogServiceProvider::class,
    ]

    'aliases' => [
        'ActionLog' => luoyangpeng\ActionLog\Facades\ActionLogFacade::class,
    ]

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


update

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

add

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

delete

Users:destroy(1);



use ActionLog;

ActionLog::createActionLog($type,$content);
ActionLog::ApiLog($type,$content,$result);

$ php artisan vendor:publish
$ php artisan migrate