Manages Laravel authentication setup and customization using Fortify.
Install
mkdir -p .claude/skills/fortify-development && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10665" && unzip -o skill.zip -d .claude/skills/fortify-development && rm skill.zipInstalls to .claude/skills/fortify-development
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
ACTIVATE when the user works on authentication in Laravel. This includes login, registration, password reset, email verification, two-factor authentication (2FA/TOTP/QR codes/recovery codes), profile updates, password confirmation, or any auth-related routes and controllers. Activate when the user mentions Fortify, auth, authentication, login, register, signup, forgot password, verify email, 2FA, or references app/Actions/Fortify/, CreateNewUser, UpdateUserProfileInformation, FortifyServiceProvider, config/fortify.php, or auth guards. Fortify is the frontend-agnostic authentication backend for Laravel that registers all auth routes and controllers. Also activate when building SPA or headless authentication, customizing login redirects, overriding response contracts like LoginResponse, or configuring login throttling. Do NOT activate for Laravel Passport (OAuth2 API tokens), Socialite (OAuth social login), or non-auth Laravel features.Key capabilities
- →Configure authentication routes
- →Implement 2FA and TOTP
- →Manage email verification
- →Customize password reset flows
- →Setup headless SPA auth
How it works
Fortify acts as a headless backend that registers authentication routes and controllers, allowing developers to customize business logic via actions and response contracts.
Inputs & outputs
When to use fortify-development
- →Configure 2FA
- →Customize login redirect
- →Handle password reset
- →Setup headless authentication
About this skill
Laravel Fortify Development
Fortify is a headless authentication backend that provides authentication routes and controllers for Laravel applications.
Documentation
Use search-docs for detailed Laravel Fortify patterns and documentation.
Usage
- Routes: Use
list-routeswithonly_vendor: trueandaction: "Fortify"to see all registered endpoints - Actions: Check
app/Actions/Fortify/for customizable business logic (user creation, password validation, etc.) - Config: See
config/fortify.phpfor all options including features, guards, rate limiters, and username field - Contracts: Look in
Laravel\Fortify\Contracts\for overridable response classes (LoginResponse,LogoutResponse, etc.) - Views: All view callbacks are set in
FortifyServiceProvider::boot()usingFortify::loginView(),Fortify::registerView(), etc.
Available Features
Enable in config/fortify.php features array:
Features::registration()- User registrationFeatures::resetPasswords()- Password reset via emailFeatures::emailVerification()- Requires User to implementMustVerifyEmailFeatures::updateProfileInformation()- Profile updatesFeatures::updatePasswords()- Password changesFeatures::twoFactorAuthentication()- 2FA with QR codes and recovery codes
Use
search-docsfor feature configuration options and customization patterns.
Setup Workflows
Two-Factor Authentication Setup
- [ ] Add TwoFactorAuthenticatable trait to User model
- [ ] Enable feature in config/fortify.php
- [ ] If the `*_add_two_factor_columns_to_users_table.php` migration is missing, publish via `php artisan vendor:publish --tag=fortify-migrations` and migrate
- [ ] Set up view callbacks in FortifyServiceProvider
- [ ] Create 2FA management UI
- [ ] Test QR code and recovery codes
Use
search-docsfor TOTP implementation and recovery code handling patterns.
Email Verification Setup
- [ ] Enable emailVerification feature in config
- [ ] Implement MustVerifyEmail interface on User model
- [ ] Set up verifyEmailView callback
- [ ] Add verified middleware to protected routes
- [ ] Test verification email flow
Use
search-docsfor MustVerifyEmail implementation patterns.
Password Reset Setup
- [ ] Enable resetPasswords feature in config
- [ ] Set up requestPasswordResetLinkView callback
- [ ] Set up resetPasswordView callback
- [ ] Define password.reset named route (if views disabled)
- [ ] Test reset email and link flow
Use
search-docsfor custom password reset flow patterns.
SPA Authentication Setup
- [ ] Set 'views' => false in config/fortify.php
- [ ] Install and configure Laravel Sanctum for session-based SPA authentication
- [ ] Use the 'web' guard in config/fortify.php (required for session-based authentication)
- [ ] Set up CSRF token handling
- [ ] Test XHR authentication flows
Use
search-docsfor integration and SPA authentication patterns.
Two-Factor Authentication in SPA Mode
When views is set to false, Fortify returns JSON responses instead of redirects.
If a user attempts to log in and two-factor authentication is enabled, the login request will return a JSON response indicating that a two-factor challenge is required:
{
"two_factor": true
}
Best Practices
Custom Authentication Logic
Override authentication behavior using Fortify::authenticateUsing() for custom user retrieval or Fortify::authenticateThrough() to customize the authentication pipeline. Override response contracts in AppServiceProvider for custom redirects.
Registration Customization
Modify app/Actions/Fortify/CreateNewUser.php to customize user creation logic, validation rules, and additional fields.
Rate Limiting
Configure via fortify.limiters.login in config. Default configuration throttles by username + IP combination.
Key Endpoints
| Feature | Method | Endpoint |
|---|---|---|
| Login | POST | /login |
| Logout | POST | /logout |
| Register | POST | /register |
| Password Reset Request | POST | /forgot-password |
| Password Reset | POST | /reset-password |
| Email Verify Notice | GET | /email/verify |
| Resend Verification | POST | /email/verification-notification |
| Password Confirm | POST | /user/confirm-password |
| Enable 2FA | POST | /user/two-factor-authentication |
| Confirm 2FA | POST | /user/confirmed-two-factor-authentication |
| 2FA Challenge | POST | /two-factor-challenge |
| Get QR Code | GET | /user/two-factor-qr-code |
| Recovery Codes | GET/POST | /user/two-factor-recovery-codes |
When not to use it
- →Laravel Passport OAuth2
- →Laravel Socialite integration
Prerequisites
Limitations
- →Requires MustVerifyEmail interface for verification
- →SPA mode requires Sanctum
How it compares
It provides a backend-agnostic authentication layer that separates auth logic from frontend views, unlike standard Laravel UI scaffolding.
Compared to similar skills
fortify-development side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| fortify-development (this skill) | 0 | 4mo | No flags | Intermediate |
| debug-cross-service-auth | 0 | 4mo | No flags | Intermediate |
| developing-with-fortify | 0 | 6mo | No flags | Intermediate |
| laravel-pdf | 11 | 3mo | Review | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
debug-cross-service-auth
J-Akiru5
Use when: diagnosing Supabase JWT handoff failures from Next.js frontend to Laravel backend including headers, CORS, issuer, audience, and secret mismatches.
developing-with-fortify
joshcirre
Laravel Fortify headless authentication backend development. Activate when implementing authentication features including login, registration, password reset, email verification, two-factor authentication (2FA/TOTP), profile updates, headless auth, authentication scaffolding, or auth guards in Larav
laravel-pdf
spatie
Generate PDFs from Blade views or HTML using spatie/laravel-pdf. Covers creating, formatting, saving, downloading, and testing PDFs with the Browsershot, Cloudflare, or DOMPDF driver.
laravel-specialist
Jeffallan
Use when building Laravel 10+ applications requiring Eloquent ORM, API resources, or queue systems. Invoke for Laravel models, Livewire components, Sanctum authentication, Horizon queues.
pennant-development
laravel
Manages feature flags with Laravel Pennant. Activates when creating, checking, or toggling feature flags; showing or hiding features conditionally; implementing A/B testing; working with @feature directive; or when the user mentions feature flags, feature toggles, Pennant, conditional features, rollouts, or gradually enabling features.
developing-shopper
shopperlabs
Provides coding standards and patterns for Laravel Shopper development. Use when creating or modifying Models, Actions, Enums, Livewire components, migrations, or tests in any Shopper package.