fabpl/laravel-model-login

Laravel package to collect login attempt

1.1.0 2021-02-21 12:23 UTC

This package is auto-updated.

Last update: 2024-09-29 05:56:22 UTC


README

Simply collect login attempt.

styleci.io

Installation

Install package via composer:

composer require fabpl/laravel-model-login

Optionally you can publish config and mmigrations files with:

php artisan model-login:publish

Migrate the logins table:

php artisan migrate

Usage

Add the HasLogins trait to your user model.

use Fabpl\ModelLogin\Traits\HasLogins;

class User extends Authenticatable
{
    use HasLogins;
}

Retrieving logins

You can get the logins collections:

$userModel->logins;
$userModel->successful_logins;
$userModel->failed_logins;

You can browser logins using LoginInterface binding:

use Fabpl\ModelLogin\Contracts\LoginInterface;

public function index(LoginInterface $login) 
{
    $logins = $login->all();
    
    //
}

Changelog

Please see CHANGELOG.

Security

If you discover any security related issues, please email planchettefabrice at hotmail.com instead of using the issue tracker.

Credits