fortify-development

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

Updated Jul 2, 2026
One-click install
npx skills add https://github.com/stacktracelabs/laravel-ui-starter-kit --skill fortify-development-stacktracelabs
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: fortify-development
Source: https://github.com/stacktracelabs/laravel-ui-starter-kit/tree/main/.agents/skills/fortify-development
Command: npx skills add https://github.com/stacktracelabs/laravel-ui-starter-kit --skill fortify-development-stacktracelabs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up authentication in Laravel involves many moving parts—routes, controllers, actions, config, and views. This Skill guides you through implementing and customizing Laravel Fortify's headless authentication backend correctly, from basic login to advanced features like two-factor authentication and passkeys. ## Core Features & Use Cases - Feature Setup Workflows: Step-by-step checklists for enabling registration, password reset, email verification, 2FA with QR codes and recovery codes, and WebAuthn passkeys. - Customization Guidance: Shows where to override behavior via app/Actions/Fortify/, response contracts like LoginResponse, and view callbacks in FortifyServiceProvider. - SPA Authentication: Covers headless SPA mode with Sanctum, including JSON-based two-factor 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, enabling the feature in config/fortify.php, publishing migrations, and testing QR codes and recovery codes. ## Quick Start Help me set up two-factor authentication with recovery codes in my Laravel app using Fortify.

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 in Laravel Fortify?▼

Add the TwoFactorAuthenticatable trait to your User model, enable Features::twoFactorAuthentication() 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 to customize user registration logic in Laravel Fortify?▼

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

Does Laravel Fortify work for SPA authentication?▼

Yes, Fortify supports SPA authentication when combined with Laravel Sanctum. Set 'views' => false in config/fortify.php, use the 'web' guard for session-based authentication, and handle CSRF tokens; Fortify then returns JSON responses instead of redirects.

What is the difference between Laravel Fortify, Passport, and Socialite?▼

Fortify is a headless authentication backend for first-party login, registration, 2FA, and passkeys. Passport provides OAuth2 API token issuance, while Socialite handles OAuth social login with third-party providers. Fortify does not cover OAuth2 or social login flows.

How do I customize login redirects in Fortify?▼

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