fortify-development

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

Updated Aug 24, 2026
One-click install
npx skills add https://github.com/Mantis-Technology/mantis-laravel --skill fortify-development-mantis-technology
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: fortify-development
Source: https://github.com/Mantis-Technology/mantis-laravel/tree/main/.agents/skills/fortify-development
Command: npx skills add https://github.com/Mantis-Technology/mantis-laravel --skill fortify-development-mantis-technology

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up authentication in Laravel involves many moving parts: routes, controllers, actions, config options, and feature flags. This Skill guides you through implementing and customizing Laravel Fortify's headless authentication backend without missing critical setup steps. ## Core Features & Use Cases - Feature Setup Workflows: Step-by-step checklists for registration, password reset, email verification, two-factor authentication, and passkeys (WebAuthn). - Customization Guidance: Shows where to override behavior via app/Actions/Fortify/, response contracts like LoginResponse, and FortifyServiceProvider view callbacks. - SPA Authentication: Covers headless SPA setup with Sanctum, session guards, CSRF handling, and JSON two-factor challenge responses. - Use Case: You need to add 2FA with QR codes and recovery codes 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 the flow. ## Quick Start Ask the AI to set up two-factor authentication with QR codes and recovery codes in your Laravel application 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 invokes this action when handling the POST /register endpoint, so no controller changes are needed.

Does Laravel Fortify work for SPA authentication?▼

Yes, Fortify supports SPA authentication when paired 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. This Skill does not cover Passport or Socialite.

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.

Why does Fortify login return JSON with two_factor true?▼

This happens in SPA mode when views are disabled and the user has two-factor authentication enabled. The JSON response indicates a two-factor challenge is required, and the client should submit the code to the /two-factor-challenge endpoint.