name('home'); /* |-------------------------------------------------------------------------- | Local test login |-------------------------------------------------------------------------- | | Temporary stand-in for the real login, which arrives in phase 1. Exists | only when APP_ENV=local: it signs in a test user and returns to the page | that asked for login. Named "login" so the auth middleware redirects here. | Remove it when the real login page is built. | */ if (app()->environment('local')) { Route::get('/dev/login', function () { $user = User::query()->firstOrCreate( ['email' => 'testikayttaja@example.test'], ['name' => 'Testikäyttäjä', 'password' => Str::password()], ); Auth::login($user); request()->session()->regenerate(); return redirect()->intended(route('customers.index')); })->middleware('web')->name('login'); }