Overview
Dashboard Laravel provides comprehensive security features to protect your application and user data. Configure authentication methods, password policies, two-factor authentication (2FA), and session management.Password Management
Changing Your Password
Update your account password through the Security tab in the configuration panel.Password Reset Configuration
Configure password reset behavior inconfig/auth.php:
Password Configuration Options
Password Configuration Options
Key Settings:
- provider: User provider for password resets (
users) - table: Database table for reset tokens (
password_reset_tokens) - expire: Token expiration time in minutes (default: 60)
- throttle: Seconds between reset attempts (default: 60)
Password Confirmation Timeout
Control how long users can perform sensitive actions without re-entering their password:Default timeout is 10,800 seconds (3 hours). Adjust based on your security requirements.
Two-Factor Authentication (2FA)
Enabling 2FA
Add an extra layer of security to your account with two-factor authentication.- Setup Process
- Best Practices
2FA Configuration Steps:
- Toggle the “Activar 2FA” switch
- Click “Configurar 2FA” button
- Scan QR code with authenticator app
- Enter verification code to confirm
- Save backup codes securely
Recommended authenticator apps: Google Authenticator, Authy, Microsoft Authenticator
Authentication Configuration
Authentication Guards
Laravel uses guards to define how users are authenticated for each request.- Default Guard:
web(session-based authentication) - Driver:
session(uses Laravel’s session system) - Provider:
users(Eloquent user model)
User Providers
Define how users are retrieved from your database:The Eloquent driver uses the User model to retrieve authentication data.
Session Security
Session Configuration
Secure session management is critical for protecting user authentication.Session Settings Explained
Session Settings Explained
Key Configuration Options:
| Setting | Default | Purpose |
|---|---|---|
driver | database | Where sessions are stored |
lifetime | 120 | Session duration in minutes |
expire_on_close | false | End session when browser closes |
encrypt | false | Encrypt session data |
table | sessions | Database table for sessions |
Database driver is recommended for production environments.
Cookie Security
Protect session cookies with secure configuration:- HTTP Only
- SameSite
CSRF Protection
Laravel automatically protects against Cross-Site Request Forgery (CSRF) attacks.How CSRF Works
All forms in Dashboard Laravel include CSRF tokens:CSRF tokens are automatically validated on POST, PUT, PATCH, and DELETE requests.
CSRF Token Verification
Laravel’s middleware validates CSRF tokens for all state-changing requests:Encryption
Application Key
Laravel uses an encryption key for securing sensitive data:Encrypted Session Data
Optionally encrypt all session data:Security Best Practices
Production Security Checklist
Production Security Checklist
- Enable HTTPS and secure cookies
- Set strong
APP_KEYencryption key - Enable two-factor authentication for admins
- Use database session driver
- Set
http_onlytotruefor cookies - Configure
same_sitetolaxorstrict - Set appropriate session lifetime
- Implement password confirmation for sensitive actions
- Regularly rotate passwords
- Monitor authentication logs
Environment Variables
Key security-related environment variables:Review and adjust these values based on your security requirements.
Related Resources
- Settings Configuration - User profile and preferences
- Notifications - Security alerts and notifications
- User Authentication - Login and signup processes
