PHP code example of label84 / laravel-auth-log

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

    

label84 / laravel-auth-log example snippets


// config/authlog.php

return [
    // ...
    'events' => [
        \Illuminate\Auth\Events\Registered::class,
        \Illuminate\Auth\Events\Attempting::class,
        // \Illuminate\Auth\Events\Authenticated::class,
        \Illuminate\Auth\Events\Login::class,
        \Illuminate\Auth\Events\Failed::class,
        // \Illuminate\Auth\Events\Validated::class,
        \Illuminate\Auth\Events\Verified::class,
        // \Illuminate\Auth\Events\Logout::class,
        // \Illuminate\Auth\Events\CurrentDeviceLogout::class,
        // \Illuminate\Auth\Events\OtherDeviceLogout::class,
        \Illuminate\Auth\Events\Lockout::class,
        \Illuminate\Auth\Events\PasswordReset::class,
    ],
];

// .env

AUTH_LOG_ENABLED=true
sh
php artisan vendor:publish --provider="Label84\AuthLog\AuthLogServiceProvider" --tag="config"
php artisan vendor:publish --provider="Label84\AuthLog\AuthLogServiceProvider" --tag="migrations"
sh
php artisan migrate