PHP code example of reazzon / jwtauth-plugin

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

    

reazzon / jwtauth-plugin example snippets


Route::group(['middleware' => [\ReaZzon\JWTAuth\Http\Middlewares\ResolveUser::class]], function () {

  // Routes only for authenticated users
  
});

Route::get('account', function () {

   // Logic that should be available only for authenticated users
   
})->middleware(\ReaZzon\JWTAuth\Http\Middlewares\ResolveUser::class);
bash
php artisan plugin:install ReaZzon.JWTAuth
bash
php artisan jwt:secret