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(config: __DIR__ . '/../.env', table: 'users', login: 'email', ttl: 30, uuid: false);
$auth->init();


use vielhuber\simpleauth\simpleauth;
$auth = new simpleauth(config: __DIR__ . '/../.env', table: 'users', login: 'email', ttl: 30, uuid: false);
$auth->isLoggedIn();
$auth->getCurrentUserId();
sh
php auth/index.php migrate
php auth/index.php create "[email protected]" "secret"
sh
php -S localhost:8007 -t auth
./vendor/bin/phpunit