Professional, customizable login and registration pages with multiple layouts, dark/light themes, captcha, OTP, email verification, password reset, lockout protection, and seamless integration with the Tyro package.
composer require hasinhayder/tyro-login
Everything you need for beautiful, secure authentication pages
Choose from 5 beautiful layouts: centered, split-left, split-right, fullscreen, and card. Each layout is fully responsive and professionally designed.
Automatic theme detection with manual toggle. Respects user preferences and system settings out of the box.
Cache-based lockout protection after failed attempts. Configurable limits, duration, and beautiful lockout page.
Simple addition/subtraction captcha to prevent automated submissions. No external APIs required.
Two-factor authentication via email OTP. Beautiful digit-by-digit input with resend and cooldown support.
Time-Based 2FA via QR code. Compatible with Google Authenticator, Authy, Microsoft Authenticator, and more.
Optional email verification for new registrations. Secure signed URLs with configurable expiration times.
Complete forgot password flow with secure reset links. Users can reset passwords and auto-login after reset.
Sleek, minimal HTML email templates for OTP, password reset, email verification, and welcome emails. Fully customizable.
Seamless integration with the Tyro package. Auto-assign roles to new users upon registration.
Sign in with Google, Facebook, GitHub, Twitter/X, LinkedIn, Bitbucket, GitLab, and Slack. Auto-link accounts by email.
Uses shadcn/ui CSS variables for easy customization. Edit themes visually with tweakcn.com and copy-paste your colors.
No npm, webpack, or vite required. Just install via Composer and you're ready to go. Works immediately.
Customize colors, logos, redirects, messages, and more via config file or environment variables.
Beautiful, professional authentication screens for every scenario
Choose the perfect layout for your application's branding
Clean, minimal design with the form centered on a gradient background. Perfect for a modern, focused login experience.
TYRO_LOGIN_LAYOUT=centered
Two-column design with a stunning background image on the left and the form on the right. Great for showcasing your brand.
TYRO_LOGIN_LAYOUT=split-left
Form on the left with background image on the right. Another great option for brand-focused authentication pages.
TYRO_LOGIN_LAYOUT=split-right
Full-screen background image with glassmorphism form overlay. Features frosted glass effect and backdrop blur for a premium, modern look.
TYRO_LOGIN_LAYOUT=fullscreen
Floating card design with subtle radial gradient background patterns. Smooth hover animations and elevated shadows for visual depth.
TYRO_LOGIN_LAYOUT=card
Simple yet effective bot protection without external dependencies
Add a simple math captcha to your login and registration forms. Users solve a basic addition or subtraction problem to prove they're human.
# Enable captcha on login form
TYRO_LOGIN_CAPTCHA_LOGIN=true
# Enable captcha on registration form
TYRO_LOGIN_CAPTCHA_REGISTER=true
Add an extra layer of security with email-based one-time passwords
After entering valid credentials, users receive a one-time password via email. They must enter the OTP to complete the login process.
# Enable OTP verification for login
TYRO_LOGIN_OTP_ENABLED=true
# OTP configuration
TYRO_LOGIN_OTP_LENGTH=4 # 4-8 digits
TYRO_LOGIN_OTP_EXPIRE=5 # minutes
TYRO_LOGIN_OTP_MAX_RESEND=3 # max resend attempts
TYRO_LOGIN_OTP_RESEND_COOLDOWN=60 # seconds
Industry-standard TOTP authentication compatible with all major authenticator apps
Enable Time-Based One-Time Password (TOTP) two-factor authentication for maximum security. Users scan a QR code with their authenticator app and enter time-based codes on each login.
From installation to beautiful auth pages in under a minute
composer require hasinhayder/tyro-login
php artisan tyro-login:install
Publishes config and sets up routes automatically
That's it! Visit /login to see your beautiful new authentication pages.
Customize everything via config or environment variables
return [
// Layout: 'centered', 'split-left', 'split-right'
'layout' => env('TYRO_LOGIN_LAYOUT', 'centered'),
// Custom branding
'branding' => [
'app_name' => env('APP_NAME', 'Laravel'),
'logo' => env('TYRO_LOGIN_LOGO', null),
],
// Math captcha protection
'captcha' => [
'enabled_login' => env('TYRO_LOGIN_CAPTCHA_LOGIN', false),
'enabled_register' => env('TYRO_LOGIN_CAPTCHA_REGISTER', false),
],
// Two-factor authentication via OTP
'otp' => [
'enabled' => env('TYRO_LOGIN_OTP_ENABLED', false),
'length' => 4, // 4-8 digits
'expire' => 5, // minutes
],
// Lockout protection (cache-based)
'lockout' => [
'enabled' => true,
'max_attempts' => 5,
'duration_minutes' => 15,
],
// Debug mode for development
'debug' => env('TYRO_LOGIN_DEBUG', false),
];
Built with security best practices from the ground up
All forms include CSRF tokens for protection against cross-site request forgery attacks.
Temporarily lock accounts after too many failed attempts. Cache-based, no database required.
Uses Laravel's secure bcrypt hashing for all passwords. Industry-standard security.
Automatic session regeneration on login prevents session fixation attacks.
Server-side validation with proper sanitization and error messages.
Verify user email addresses before granting access. Secure signed URLs with expiration.
Time-limited, signed URLs for password reset. Auto-login after successful reset.
Simple configurable math challenges to block bots. No external services or API keys required.
Two-factor authentication via email. One-time passwords with expiration and resend limits.
All authentication routes registered automatically
| Method | URI | Name | Description |
|---|---|---|---|
| GET | /login |
tyro-login.login |
Show login form |
| POST | /login |
tyro-login.login.submit |
Handle login |
| GET | /register |
tyro-login.register |
Show registration form |
| POST | /register |
tyro-login.register.submit |
Handle registration |
| GET/POST | /logout |
tyro-login.logout |
Handle logout |
| GET | /lockout |
tyro-login.lockout |
Show lockout page |
| GET | /email/verify |
tyro-login.verification.notice |
Verification notice |
| GET | /email/not-verified |
tyro-login.verification.not-verified |
Unverified email page |
| GET | /email/verify/{token} |
tyro-login.verification.verify |
Verify email |
| POST | /email/resend |
tyro-login.verification.resend |
Resend verification |
| GET | /forgot-password |
tyro-login.password.request |
Forgot password form |
| POST | /forgot-password |
tyro-login.password.email |
Send reset link |
| GET | /reset-password/{token} |
tyro-login.password.reset |
Reset password form |
| POST | /reset-password |
tyro-login.password.update |
Update password |
| GET | /otp/verify |
tyro-login.otp.verify |
Show OTP form |
| POST | /otp/verify |
tyro-login.otp.submit |
Verify OTP code |
| POST | /otp/resend |
tyro-login.otp.resend |
Resend OTP |
| GET | /otp/cancel |
tyro-login.otp.cancel |
Cancel OTP verification |
| GET | /auth/{provider}/redirect |
tyro-login.social.redirect |
Redirect to OAuth provider |
| GET | /auth/{provider}/callback |
tyro-login.social.callback |
Handle OAuth callback |
Everything you need to know about Tyro Login
Tyro Login is a Laravel package that provides beautiful, customizable login and registration pages. It includes multiple layout options, dark/light themes, lockout protection, and seamless integration with the Tyro RBAC package.
Tyro Login requires PHP 8.2 or higher and Laravel 12. It works with any database supported by Laravel (MySQL, PostgreSQL, SQLite, SQL Server).
No, Tyro Login works independently. However, if you have the Tyro package installed, it will automatically integrate with it to assign default roles to new users upon registration.
Ensure you're using PHP 8.2+ and Laravel 12. Run composer update first. Check your minimum-stability in composer.json. If using older Laravel versions, upgrade your framework first.
Tyro Login works seamlessly with Laravel's default authentication system. No migration is required - your existing users and data remain completely unchanged. Simply install Tyro Login and it will integrate automatically. You can optionally disable Laravel's default auth routes in routes/web.php if you prefer to use only Tyro Login's routes.
Yes! Run php artisan tyro-login:publish --views to publish the Blade templates to your application. You can then modify them as needed. You can also customize colors and branding via environment variables without touching any code.
Set the TYRO_LOGIN_LAYOUT environment variable to centered, split-left, or split-right. You can also set a custom background image URL with TYRO_LOGIN_BACKGROUND_IMAGE.
Publish views with php artisan tyro-login:publish --views and modify CSS. You can also override CSS variables or use your own stylesheet.
Check your mail configuration in config/mail.php. Verify SMTP settings and ensure TYRO_LOGIN_DEBUG=true to see logged email URLs during development. Some email providers may require additional configuration.
Yes! Set TYRO_LOGIN_USER_MODEL to your custom User model class. Your model just needs to implement Laravel's Authenticatable contract.
Yes! Use TYRO_LOGIN_ROUTE_PREFIX to add a prefix (e.g., 'auth' makes URLs /auth/login). All routes will be prefixed automatically.
When enabled, users are locked out after a configurable number of failed login attempts (default 5). The lockout is stored in cache (no database required) and automatically expires after a configurable duration (default 15 minutes). A beautiful lockout page shows a countdown timer.
The math captcha displays a simple addition or subtraction problem (e.g., "5 + 3 = ?") on your login and/or registration forms. Enable it with TYRO_LOGIN_CAPTCHA_LOGIN=true or TYRO_LOGIN_CAPTCHA_REGISTER=true. No external APIs required - answers are stored in the session.
Set TYRO_LOGIN_OTP_ENABLED=true in your .env file. After entering valid credentials, users receive a one-time password via email. Configure OTP length (4-8 digits) with TYRO_LOGIN_OTP_LENGTH and expiration time with TYRO_LOGIN_OTP_EXPIRE. All OTP data is stored in cache - no database required.
Yes! It includes CSRF protection, secure password hashing, session regeneration, and uses signed URLs for sensitive operations. Always use HTTPS in production and never enable debug mode.
Debug mode (TYRO_LOGIN_DEBUG=true) logs OTP codes, verification URLs, and password reset URLs to storage/logs/laravel.log. This makes it easy to test email-based features during development without actually sending emails. Never enable this in production!
Both features use secure, time-limited signed URLs stored in cache (no database migrations required). Email verification can be enabled via TYRO_LOGIN_REQUIRE_VERIFICATION=true. Password reset shows a "Forgot Password?" link on the login page. In development, verification and reset URLs are logged to the console for easy testing.
Yes! Tyro Login works with any email service configured in Laravel's mail.php (SendGrid, Mailgun, SES, etc.). Just configure your service and emails will work.
Enable debug mode with TYRO_LOGIN_DEBUG=true. All email URLs, OTP codes, and reset tokens will be logged to storage/logs/laravel.log. For development, you can also use email debugging services like MailTrap or Mailpit to capture and inspect sent emails without affecting real users. These services provide real-time email previews, delivery tracking, and webhook testing capabilities.
Tyro Login supports 8 OAuth providers: Google, Facebook, GitHub, Twitter/X, LinkedIn, Bitbucket, GitLab, and Slack. Each provider can be individually enabled or disabled.
Run php artisan tyro-login:install --with-social to install with social login support. Then set TYRO_LOGIN_SOCIAL_ENABLED=true and enable desired providers like TYRO_LOGIN_SOCIAL_GOOGLE=true. Configure provider credentials in config/services.php.
Yes! When TYRO_LOGIN_SOCIAL_LINK_EXISTING=true (default), if a user signs in with a social account that has the same email as an existing user, the accounts are automatically linked and the user is logged in.
No! Tyro Login uses Laravel's cache system for all temporary data (lockouts, OTP codes, verification tokens, password reset tokens). This means zero database migrations and works with any cache driver (file, Redis, Memcached, etc.).
Minimal impact. It uses cache for temporary data (no database queries) and lazy-loads views. Email operations can be queued for better performance.
Tyro Login uses Laravel's cache system. Ensure your cache driver is properly configured in config/cache.php. File cache works out of the box, Redis/Memcached need proper setup.
Tyro Login uses Laravel's cache system. Ensure your cache driver is properly configured in config/cache.php. File cache works out of the box, Redis/Memcached need proper setup.
Yes! Use TYRO_LOGIN_ROUTE_PREFIX to add a prefix (e.g., 'auth' makes URLs /auth/login). All routes will be prefixed automatically.
Use Laravel's built-in auth middleware or guest middleware for public pages. Tyro Login integrates seamlessly with Laravel's authentication system.
Disable debug mode (TYRO_LOGIN_DEBUG=false), use HTTPS, configure proper email service, set appropriate lockout limits, and consider rate limiting.
Yes! It works with any Laravel setup. For multi-tenant, ensure your cache and session configurations are tenant-aware.
Get started with Tyro Login in just 2 commands
composer require hasinhayder/tyro-login
Social Login with OAuth
Let users sign in with their favorite social accounts using Laravel Socialite
8 Providers Out of the Box
Tyro Login integrates seamlessly with Laravel Socialite to provide OAuth authentication with popular social platforms. Each provider can be individually enabled or disabled.