Laravel doesn't force you to build login/register flows from scratch. Several official starter packages handle the heavy lifting:
- Laravel Breeze — a minimal, easy-to-read starter kit with login, registration, password reset, and email verification, using Blade or Livewire/Inertia views. Great for learning how auth actually works under the hood.
- Laravel Fortify — a headless (backend-only) authentication backend, ideal when you want to design your own UI or use it with a SPA/mobile frontend.
- Laravel Sanctum — lightweight API token authentication, perfect for SPAs, mobile apps, and simple token-based APIs. Since Laravel 13, Sanctum-issued sessions also support passkey (WebAuthn) authentication alongside traditional passwords.
- Laravel Socialite — OAuth login with GitHub, Google, Facebook, and other providers in a few lines of code.
Basic manual authentication:
use Illuminate\Support\Facades\Auth;
if (Auth::attempt(['email' => $email, 'password' => $password])) {
request()->session()->regenerate();
return redirect()->intended('dashboard');
}
Auth::logout();
Inside a controller or view, Auth::user() (or auth()->user()) returns the currently logged-in user, and the auth middleware protects routes from unauthenticated access.