PHP code example of vielhuber / simpleauth

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

    

vielhuber / simpleauth example snippets



ielhuber\simpleauth\simpleauth;
$auth = new simpleauth(__DIR__ . '/../.env');
if (php_sapi_name() !== 'cli') {
    $auth->api();
} elseif (@$argv[1] === 'migrate') {
    $auth->migrate();
} elseif (@$argv[1] === 'seed') {
    $auth->seed();
}


use vielhuber\simpleauth\simpleauth;
$auth = new simpleauth(__DIR__ . '/.env');

$auth->isLoggedIn();
$auth->getCurrentUserId();
sh
php auth/index.php migrate
php auth/index.php seed