fortify-development

Implements Laravel Fortify authentication features including login, registration, 2FA, and password reset.

1|Updated Jun 6, 2026
One-click install
npx skills add https://github.com/karuhun-developer/ecommerce --skill fortify-development-karuhun-developer
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: fortify-development
Source: https://github.com/karuhun-developer/ecommerce/tree/main/.cursor/skills/fortify-development
Command: npx skills add https://github.com/karuhun-developer/ecommerce --skill fortify-development-karuhun-developer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up authentication in Laravel involves many moving parts—routes, actions, config, view callbacks, and feature flags. This Skill guides you through implementing and customizing Laravel Fortify's headless authentication backend correctly, from basic login to two-factor authentication. ## Core Features & Use Cases - Feature Setup Workflows: Step-by-step checklists for enabling registration, password reset, email verification, profile updates, and two-factor authentication in config/fortify.php. - Customization Guidance: Shows where to override behavior—app/Actions/Fortify/ for user creation logic, FortifyServiceProvider for view callbacks, and response contracts like LoginResponse for custom redirects. - SPA Authentication: Covers headless mode with views disabled, Sanctum session integration, and JSON-based 2FA challenge flows. - Use Case: You need to add two-factor authentication to an existing Laravel app. The Skill walks you through adding the TwoFactorAuthenticatable trait, publishing migrations, enabling the feature, and testing QR codes and recovery codes. ## Quick Start Help me set up two-factor authentication with Laravel Fortify in my application.

Frequently Asked Questions about fortify-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up two-factor authentication with Laravel Fortify?▼

Add the TwoFactorAuthenticatable trait to your User model, enable the twoFactorAuthentication feature in config/fortify.php, and publish the Fortify migrations if the two-factor columns are missing. Then set up view callbacks in FortifyServiceProvider and build a UI for QR codes and recovery codes.

How do I customize user registration in Laravel Fortify?▼

Modify app/Actions/Fortify/CreateNewUser.php to change validation rules, add fields, or adjust user creation logic. Fortify calls this action when handling the POST /register endpoint, so no controller changes are needed.

Does Laravel Fortify work for SPA authentication?▼

Yes, set 'views' => false in config/fortify.php and pair Fortify with Laravel Sanctum for session-based SPA authentication. Fortify then returns JSON responses, such as {"two_factor": true} when a 2FA challenge is required.

How do I customize the login redirect in Fortify?▼

Override the LoginResponse contract in a service provider to control post-login redirects. You can also use Fortify::authenticateUsing() for custom user retrieval or Fortify::authenticateThrough() to modify the authentication pipeline.

When should I not use Laravel Fortify?▼

Fortify is not suited for OAuth2 API token issuance, which is Laravel Passport's role, or for social login, which is handled by Socialite. It focuses on session-based authentication routes and controllers for traditional and SPA apps.