PHP code example of irius-digital / last-login-activity

1. Go to this page and download the library: Download irius-digital/last-login-activity 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/ */

    

irius-digital / last-login-activity example snippets


return [
    'save_last_login' => [
        'enabled' => env('SAVE_LAST_LOGIN', true),
    ],
];

use Illuminate\Auth\Events\Login;
use IriusDigital\LastLoginActivity\Events\LastActivityEvent;


protected $listen = [
        Login::class => [
            LastActivityEvent::class,
        ],
    ];

use IriusDigital\LastLoginActivity\Traits\LoginActivities;

class User extends Authenticatable
{
    ...
    use LoginActivities;
    

    $user->latestLoggedIp
    
    $user->loginActivities
bash
php artisan vendor:publish --tag="last-login-activity-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="last-login-activity-config"