In this post, I am going to explain about login with Magic Link in LARAVEL 9. To make password less login with Magic Link, we are going to us https://github.com/grosv/laravel-passwordless-login Package.

Update the app/Http/Controllers/Auth/LoginControlller.php add the login & Login with Magic Link Function. middleware('guest')->except('logout'); } public function username() { return 'username'; } public function login(Request $request) { if($request->input('submit') == 'magic-link'){ $user = $this->loginViaMagicLink($request); if(!$user){ return redirect()->route('login') ->withErrors(['username' => 'User with this username does not exist.']) ->withInput(); } return redirect()->route('login') ->withMessage('Magic Link Sent to the registered email ID.'); } $this->validateLogin($request); // If the class is using the ThrottlesLogins trait, we can automatically throttle // the login attempts for this application.

setRedirectUrl('/home'); $url = $generator->generate(); return (new MailMessage) ->subject('Your Login Magic Link!') ->line('Click this link to log in!') ->action('Login', $url) ->line('Thank you for using our application!'); }
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners