laravel-model-login maintained by fabpl
Laravel Model Login
Simply collect login attempt.
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.