PHP code example of areia-lab / laravel-login-notifier
1. Go to this page and download the library: Download areia-lab/laravel-login-notifier library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
areia-lab / laravel-login-notifier example snippets
use Illuminate\Support\Facades\Auth;
Auth::attempt(['email' => '[email protected]', 'password' => 'password']);
use AreiaLab\LoginNotifier\Facades\LoginHistory;
// Get all login histories
$all = LoginHistory::getAllHistories();
// Get recent 10 logins
$recent = LoginHistory::getRecentHistories(10);
// Get all logins for a specific user
$userLogins = LoginHistory::getUserHistories($userId);
// Get last login of a user
$lastLogin = LoginHistory::getLastLoginForUser($userId);
// Get logins from new devices for a user
$newDeviceLogins = LoginHistory::getNewDeviceLoginsForUser($userId);