Laravel Multi-Role Auth Starter

Description
Skip weeks of boilerplate. This is a complete, production-ready authentication system for Laravel — not a tutorial, not a skeleton. Real code you can drop into your project today.
What's included: - 4 auth controllers: Login, Register, OTP Password Reset, Force Password Change - RoleMiddleware — guards routes by role with a clean, extensible design - ForcePasswordChange middleware — intercepts sessions and redirects until password is updated - 6 Form Request classes covering all auth inputs with proper validation rules - User model + StaffInfo model with relationships - Full database migration with role columns and indexes - Admin seeder — seed your first superadmin with one command
The flow this covers: User registers → role assigned → login → OTP reset if needed → force-change on first login (for staff) → role-based route access
Who this is for: Any Laravel developer building a system with admins, staff, managers, or customers — SaaS apps, HR systems, clinic portals, POS systems, internal dashboards.
Stop rewriting auth from scratch on every project.
Features
- LoginController with remember-me and role-aware redirect - RegisterController with role assignment on signup - OTP Password Reset — generates and validates one-time codes - ForcePasswordChange controller and middleware flow - RoleMiddleware supporting multiple roles per route - 6 Form Request classes (Login, Register, OtpRequest, OtpVerify, ResetPassword, ChangePassword) - User model with role relationship - StaffInfo model linked to User - Migration with role column, indexes, and foreign keys - Admin seeder for first superadmin account - Compatible with Laravel 10 and 11 - No third-party auth packages required
Requirements
- PHP 8.1 or higher - Laravel 10 or Laravel 11 - MySQL 5.7+ or MariaDB 10.3+ - Composer - An SMTP mail driver (for OTP email delivery)
Instructions
1. Copy the provided files into your Laravel project following the included directory structure. 2. Run: php artisan migrate 3. Run: php artisan db:seed --class=AdminSeeder (creates your first superadmin) 4. Register the auth routes in routes/web.php or routes/api.php as shown in the README. 5. Add RoleMiddleware to your Kernel $routeMiddleware array. 6. Add ForcePasswordChange middleware to the middleware group or specific route groups for staff. 7. Configure your SMTP settings in .env for OTP email delivery. 8. Customize role names and redirect paths in the config file if needed. 9. See README for full route examples and role guard usage.
| Author | CLAF |
|---|---|
| Category | Scripts & Code / PHP Scripts / Login |
| Price | $34 |
| Extended License | $102 |
| First Release | Jun 7, 2026 |
| Last Update | Jun 7, 2026 |
| Files included | .php, .sql |
| Software version | PHP 8.1, PHP 8.2, PHP 8.3 |
Categories
Tags
External listing. code.market does not sell this product and does not process payment for it. Pricing, payment, delivery, licensing, refunds, and support are handled by the third-party merchant on its own website. We may earn an affiliate commission from a referral. Details.
Products of the Week.
Submit🥇
Free LinkedIn Likes From Real Members | LinkedInLikes
Get free LinkedIn likes on your posts from real members who react by hand. No password needed: you only share a link.
Website · 12,847 views · 46 clicksWebsite · Week 49 · 12,847 views · 46 clicks
🥈
Free Medium Claps From Real Writers | MediumPlace
Free Medium claps on your stories from verified accounts of real writers, each given by hand. No bots, no Medium password, nothing to pay. Paste a link.
Website · 7,964 views · 10 clicksWebsite · Week 49 · 7,964 views · 10 clicks
🥉
Free GitHub Stars From Real Developers | GitWow
Get free GitHub stars on your repository from real developers who star by hand. No token or password, and it's free.
Website · 15,624 views · 28 clicksWebsite · Week 49 · 15,624 views · 28 clicks
#4
Free Substack Likes From Real Writers | StackRooms
Free Substack likes on your posts and Notes from verified accounts of real writers, given by hand. Free to ask, free to receive. Just share a link.
Website · 7,784 views · 2 clicksWebsite · Week 49 · 7,784 views · 2 clicks
#5
Free Twitter Likes From Real People | SupaTwitter
Free Twitter likes on your tweets from verified accounts of real people, each given by hand. No bots, no Twitter password, nothing to pay. Paste a link.
Website · 7,679 views · 4 clicksWebsite · Week 49 · 7,679 views · 4 clicks
#6
Free X Likes From Real People, Given by Hand | XFast
Free X likes on your posts from verified accounts of real people, each one given by hand. No bots, no X password, no conditions. Paste a link to start.
Website · 7,591 views · 0 clicksWebsite · Week 49 · 7,591 views · 0 clicks