PHP code example of luoyangpeng / action-log

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

    

luoyangpeng / action-log example snippets


    'providers' => [
        // ...
        'luoyangpeng\ActionLog\ActionLogServiceProvider',
    ]

    'providers' => [
        // ...
        luoyangpeng\ActionLog\ActionLogServiceProvider::class,
    ]

    'aliases' => [
        // ...
        'ActionLog' => 'luoyangpeng\ActionLog\Facades\ActionLogFacade',
    ]

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

//填写要记录的日志的模型名称
	return [
		'\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 ActionLog

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

$ php artisan vendor:publish
$ php artisan migrate