PHP code example of anwarelbo / laravel-authentication-log

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

    

anwarelbo / laravel-authentication-log example snippets


use Illuminate\Notifications\Notifiable;
use Yadahan\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),

'older' => 365,