shamarkellman/auth-logger

记录应用程序执行的所有身份验证事件

1.0.4 2020-11-25 11:46 UTC

This package is auto-updated.

Last update: 2024-09-25 08:37:05 UTC


README

Laravel 包,用于记录所有身份验证事件。

要求

  • PHP >= 7.0
  • Laravel >= 5.5

安装

composer require shamarkellman/auth-logger

发布资产

php artisan vendor:publish --provider="Shamarkellman\AuthLogger\Providers\AuthLoggerServiceProvider"

运行迁移

php artisan migrate

用法

将Shamarkellman\AuthLogger\Traits\AuthLoggable特质添加到用户模型中

<?php  

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Shamarkellman\AuthLogger\Traits\AuthLoggable;

class User extends Authenticatable
{
    use Notifiable, AuthLoggable;
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];
    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];
}

待办事项

  • 记录认证和认证中
  • 测试

致谢

  • Shamar Kellman

许可

在MIT许可下发布