PHP code example of ollyxar / laravel-auth

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

    

ollyxar / laravel-auth example snippets


// if the sessions are in files by default
use Ollyxar\LaravelAuth\FileAuth;

// or if the sessions in the Redis
// use Ollyxar\LaravelAuth\RedisAuth;

// The same code for Redis except you have to call RedisAuth instead
if ($userId = FileAuth::getUserIdByHeaders($headers)) {
    // we got it!
}

$headers = [
    'Cookie' => 'someotherkey=someothervalue;laravel_session=somerandomstring'
];