PHP code example of spargon / laravel-auth-logger

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

    

spargon / laravel-auth-logger example snippets


User::find(1)->lastLoginAt(); [or] auth()->user()->lastLoginAt()

User::find(1)->lastLoginIp(); [or] auth()->user()->lastLoginIp()

User::find(1)->previousLoginAt(); [or] auth()->user()->previousLoginAt()

User::find(1)->previousLoginIp(); [or] auth()->user()->lapreviousLoginIpstLoginAt()

/**
 * The Auth Logger notifications delivery channels.
 *
 * @return array
 */
public function notifyAuthLoggerVia()
{
    return ['mail', 'slack'];
}

/**
 * Route notifications for the Slack channel.
 *
 * @param  \Illuminate\Notifications\Notification  $notification
 * @return string
 */
public function routeNotificationForSlack($notification)
{
    return 'https://hooks.slack.com/services/T01D8HUCU4.....'; // replace this with the webhook you receive from Slack
}

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

'older' => 31,
bash
php artisan auth-logger:install
bash
php artisan vendor:publish  --tag=auth-logger-views
bash
php artisan vendor:publish  --tag=auth-logger-translations