| Package Data | |
|---|---|
| Maintainer Username: | mjk |
| Maintainer Contact: | 10307440@qq.com (majikang) |
| Package Create Date: | 2016-09-30 |
| Package Last Update: | 2017-04-11 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-30 03:14:15 |
| Package Statistics | |
|---|---|
| Total Downloads: | 73 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 6 |
| Total Watchers: | 2 |
| Total Forks: | 2 |
| Total Open Issues: | 0 |
Laravel 5 操作日志记录
{
"require": {
"majikang/action-log": "~1.0"
},
}
or
Require this package with composer:
composer require majikang/action-log
Update your packages with composer update or install with composer install.
Find the providers key in config/app.php and register the ActionLog Service Provider.
for Laravel 5.1+
'providers' => [
majikang\ActionLog\ActionLogServiceProvider::class,
]
Find the aliases key in config/app.php.
for Laravel 5.1+
'aliases' => [
'ActionLog' => luoyangpeng\ActionLog\Facades\ActionLogFacade::class,
]
To use your own settings, publish config.
$ php artisan vendor:publish
config/actionlog.php
//填写要记录的日志的模型名称
return [
'\App\Models\User',
];
$ php artisan migrate
自动记录操作日志,数据库操作需按如下:
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);