Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ctrlaltdelme's avatar

2FA Package Options

I'm looking to implement 2FA in my app. I see Fortify is an official package but I don't see a whole lot about it online other than the docs. Are there other popular packages for implementing 2FA within a Laravel app?

0 likes
4 replies
Tray2's avatar

I would suggest sticking with the official package.

1 like
ctrlaltdelme's avatar

So if I use Fortify but used one of Laravel's starter kits, does it overwrite the existing routes and Controllers I have with its own? I just need 2FA functionality, so what would I use from Fortify, and how should I customize the config?

Merklin's avatar

Fortify provides only the back-end, so yes, it has its own controllers and routes. When implementing it, you should only create your own view files.

If you already have a login controller and a password controller with their own routes, but with the same URL ('/login', '/register') and so on, there will be a conflict.

You can try to implement your own functionality by extracting the necessary code from Fortify, but it will be easier to install it and use its own classes.

https://github.com/laravel/fortify/blob/1.x/routes/routes.php

Tray2's avatar

They are starter kits, and they should only be installed in the start of the project, and to answer your question, yes they might overwrite your existing routes if installed later.

1 like

Please or to participate in this conversation.