-
routes/web.php
Open in GitHubRoute::group(['middleware' => ['web']], function () { // Route::get('autologin/{username}', 'Auth\AutoLoginController@login')->name('autologin'); // });
-
app/Mail/LoginByEmail.php
Open in GitHubuse Illuminate\Mail\Mailable; use \App\User; use URL; class LoginByEmail extends Mailable { // public function build() { $login_url = URL::temporarySignedRoute( 'autologin', now()->addMinutes(30), ['username' => $this->user->username, 'redirect' => '/'] ); return $this->markdown('emails.loginbyemail') ->subject('['.setting('name').'] '. __('Your login link')) ->with('login_url', $login_url); } }