Skip to content

ShamarKellman/auth-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Auth Logger

Laravel package to log all authentication events.

Requirements

  • PHP >= 7.0
  • Laravel >= 5.5

Installation

composer require shamarkellman/auth-logger

Publish assets

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

Run migrations

php artisan migrate

Usage

Add Shamarkellman\AuthLogger\Traits\AuthLoggable trait to User Models

<?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',
    ];
}

TODO

  • Log authenticated, authenticating
  • Tests

Credits

  • Shamar Kellman

License

Published under MIT License