Laravel Fortify Cheat Sheet

Sam Ngu
6 min readMar 23, 2021

Getting authentication right is not a straightforward task. Thankfully, Laravel has released an official authentication package called Laravel Fortify that took care of everything about authentication for us.

Photo by Micah Williams on Unsplash

In summary, Fortify mainly consisted of 7 components:

  1. Login
  2. Logout
  3. Password confirmation
  4. Registration
  5. Password reset
  6. Email Verification
  7. 2-Factor Authentication

Laravel Fortify has preloaded a lot of API endpoints for us. Below is a brief overview on the endpoints that are available to us.

Login

GET /login

Returns the auth.login view.

POST /login

Request body:

  • email(string) — configurable in config/fortify.php
  • password(string)
  • remember(boolean)

Non XHR API:

On success, redirect to home route defined in fortify config.
On failure, redirect to login screen with errors.

XHR API:

On success, returns 200 HTTP response.

--

--