Laravel Passwordless login is a package by Ed Grosvenor that provides a simple, safe, magic login link generator for Laravel apps:
This package provides a temporary signed route that logs in a user. What it does not provide is a way of actually sending the link to the route to the user. This is because I don’t want to make any assumptions about how you communicate with your users.
Here’s a usage example from the project’s readme:
use App\User;
use Grosv\LaravelPasswordlessLogin\LoginUrl;
function sendLoginLink()
{
$user = User::find(1);
$generator = new LoginUrl($user);
$url = $generator->generate();
// OR Use a Facade
$url = PasswordlessLogin::forUser($user)->generate();
// Send $url in an email or text message to your user
return $url;
}
This package has configuration options that enable you to configure which model is the user model, the login route, and the number of minutes until the link expires. Check out the readme for full configuration options.
You can learn more about this package, get full installation instructions, and view the source code on GitHub at grosv/laravel-passwordless-login.
0 comments:
Post a Comment
Thanks