PHP code example of pownall / laravel-magic-login

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

    

pownall / laravel-magic-login example snippets

 php
MagicLogin::forUser($user)->generate();
 php
MagicLogin::forUser($user)
    ->redirectToUrl('/somewhere-else')
    ->generate();
 php
MagicLogin::forUser($user)
    ->redirectToUrl(route('admin.dashboard'))
    ->generate();
 php
MagicLogin::forUser($user)
    ->expireAt(Carbon::now()->addMinutes(30))
    ->generate();