PHP code example of networkrailbusinesssystems / entra

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

    

networkrailbusinesssystems / entra example snippets


     return [
         ...
         'models' => [
             'user' => User::class,
         ],
         ...
     ];
     

   Route::entra();
   

   Route::middleware('EntraAuthenticated')->group(function () {
       // Your authenticated routes here...
   }
   

   Route::middleware('EntraTokenExists')->group(function () {
       // Your authenticated token routes here...
   }
   

/** @var ?EntraAccessToken $token */
$token = Entra::currentToken();
// or
$token = Session::get(Entra::ENTRA_TOKEN);
bash
   php artisan vendor:publish --tag="entra"