PHP code example of radiate / passwordless

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

    

radiate / passwordless example snippets


$app->register(Radiate\Passwordless\PasswordlessServiceProvider::class);




namespace Plugin\Models;

use Radiate\Database\Models\User as Model;
use Radiate\Passwordless\Traits\PasswordlessLogin;

class User extends Model
{
    use PasswordlessLogin;
}




// Redirect defaults to wp-admin.php
// expiry defaults to 5 minutes
$link = $user->getPasswordlessLink($redirect, $expiry);




use Radiate\Passwordless\Facades\PasswordlessLogin;

$link = PasswordlessLogin::forUser($user)
    ->redirectTo('/')
    ->expiresIn(1 * MINUTE_IN_SECONDS)
    ->generate();