illuminate/auth
Laravel’s authentication component providing guards, user providers, password hashing, “remember me” services, and authorization gates. Powers login/session auth and integrates with HTTP middleware and the framework’s auth configuration.
laravel/framework, and is not meant for standalone usage.laravel/framework (e.g., via composer require laravel/framework), which includes illuminate/auth.config/auth.php, with guards, providers, and password reset settings.auth (via Auth::routes() or manually in routes/web.php) enforces authentication checks on routes.Auth facade or Illuminate\Support\Facades\Auth Facade for convenient interaction:
// Check if user is authenticated
if (Auth::check()) { /* ... */ }
// Get current user
$user = Auth::user();
// Attempt login with credentials
if (Auth::attempt(['email' => $email, 'password' => $password])) { /* ... */ }
config/auth.php (e.g., using JWT, OAuth, or custom database-based guards).laravel/passport or laravel/sanctum (they extend illuminate/auth under the hood).App\Services\Auth or request classes (e.g., custom Authorizable traits, pivot-role checks).Auth::guard('name') to explicitly reference guards, especially when using multiple providers (e.g., web, api, sanctum).laravel/framework instead.Auth::user() returns null silently if unauthenticated — always check with Auth::check() or use middleware (auth:web) to avoid null dereference bugs.web guard) requires StartSession middleware enabled — a common pitfall in Lumen or minimal setups.AuthenticatableContract (or extend Illuminate\Foundation\Auth\User).Auth::errors() (via the guard) and inspect config/auth.php for correct provider mapping (providers.users.model).AuthServiceProvider and hook into Auth::extend() or use custom PasswordBroker logic.How can I help you explore Laravel packages today?