PHP code example of divineomega / laravel-last-activity

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

    

divineomega / laravel-last-activity example snippets


protected $middlewareGroups = [
        'web' => [
            /* ... other web middleware ... */
            \DivineOmega\LaravelLastActivity\Http\Middleware\LastActivity::class
        ],

        'api' => [
            /* ... other api middleware ... */
            \DivineOmega\LaravelLastActivity\Http\Middleware\LastActivity::class
        ],
    ];



return [
    
    // Field in which the last activity date time will be stored.
    'field' => 'last_activity',
    
];
bash
php artisan vendor:publish --provider="DivineOmega\LaravelLastActivity\ServiceProvider"
bash
php artisan migrate