PHP code example of happydemon / usrlastly

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

    

happydemon / usrlastly example snippets


    'providers' => [
        ...
        'HappyDemon\UsrLastly\UsrLastlyServiceProvider',
    ]

	protected $middleware = [
		...
		'HappyDemon\UsrLastly\Middleware\LastSeenMiddleware'
	];

use HappyDemon\UsrLastly\LastSeenTrait as LastSeen;

use LastSeen;

php artisan vendor:publish --provider="HappyDemon\UsrLastly\UsrLastlyServiceProvider" --tag="migrations"
php artisan migrate

$user = User::find(1);

dd($user->lastSeen());

php artisan vendor:publish