1. Go to this page and download the library: Download fivesqrd/una 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/ */
fivesqrd / una example snippets
Use Una\Adapter;
/* Initialise the factory class with some defaults */
$factory = new Una\Factory([
'storage' => Adapter\Storage\BegoAdapter::instance([
'table' => 'My-Table',
'aws' => [
'region' => 'eu-west-1',
'credentials' => [
'key' => 'mykey',
'secret' => 'mysecret',
]
],
]),
'randomiser' => new Adapter\Randomiser\Numeric([
'length' => 5
]),
'hasher' => new Adapter\Hash\Password()
]);
/* Create a fresh token */
$token = $factory->create()
->ttl(86400)
->notify(function($secret) {
mail();
});
echo $token->raw();
echo $token->hashed();