PHP code example of serwin35 / laravel-authentication-log

1. Go to this page and download the library: Download serwin35/laravel-authentication-log 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/ */

    

serwin35 / laravel-authentication-log example snippets


use Illuminate\Notifications\Notifiable;
use serwin35\AuthenticationLog\AuthenticationLogable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable, AuthenticationLogable;
}

User::find(1)->authentications;

User::find(1)->lastLoginAt();

User::find(1)->lastLoginIp();

auth()->user()->previousLoginAt();

auth()->user()->previousLoginIp();

/**
 * The Authentication Log notifications delivery channels.
 *
 * @return array
 */
public function notifyAuthenticationLogVia()
{
    return ['nexmo', 'mail', 'slack'];
}

'notify' => env('AUTHENTICATION_LOG_NOTIFY', false),

'table_name' => 'users_auth_log',

'older' => 365,