PHP code example of faithfm / laravel-simple-auth0
1. Go to this page and download the library: Download faithfm/laravel-simple-auth0 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/ */
faithfm / laravel-simple-auth0 example snippets
use FaithFM\SimpleAuth0\SimpleAuth0ServiceProvider;
// Register login/logout/callback routes (for Auth0)
SimpleAuth0ServiceProvider::registerLoginLogoutCallbackRoutes();
$loggedIn = Auth::check(); // check if logged in
Route::get(...)->middleware('auth') // protect a route using 'auth' middleware
$user = auth()->user(); // get logged-in current User model (using helper function)
$user = Auth::user(); // ditto (using Facades)
// etc...