PHP code example of juriandamen / laramultiauth-v2

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

    

juriandamen / laramultiauth-v2 example snippets


RSpeekenbrink\LaraMultiAuth\ServiceProvider::class,

'LaraMultiAuth' => RSpeekenbrink\LaraMultiAuth\Facade::class

use RSpeekenbrink\LaraMultiAuth\LaraMultiAuth;

...

/**
 * The user has been authenticated.
 *
 * @param  Request $request
 * @param  mixed  $user
 * @return mixed
 */
public function authenticated(Request $request, $user)
{
    return LaraMultiAuth::handle($request, $user);
}

use RSpeekenbrink\LaraMultiAuth\HasTOTPAuth;

...

class User extends Authenticatable
{
    use HasTOTPAuth;

\RSpeekenbrink\LaraMultiAuth\LaraMultiAuth::routes();

LaraMultiAuth::setRedirectPath('/dashboard')

LaraMultAuth::setTOTPRoute('your.route.name');
bash
php artisan vendor:publish --provider="RSpeekenbrink\LaraMultiAuth\ServiceProvider"
bash
php artisan migrate
bash
php artisan make:auth