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

Garet's avatar
Level 3

Obfuscate auth/login routes with Laravel Fortify

I'm using Laravel Fortify for authentication, 2FA, password resets, etc.

With this particular application there is a front-end and a back-end, however only the back-end has login and authentication used by admin users. In other words, there is no requirement for public users to be able to access the login.

With this in mind, instead of the back-end being namespaced to admin (i.e. domain.com/admin/) I've instead namespaced it to my-admin-area (i.e. domain.com/my-admin-area/) mainly to avoid bots and general brute force and phishing attempts.

However, the routes registered by Fortify still result in URL's such as domain.com/login and domain.com/forgot-password

Ideally I would like such URL's to be domain.com/my-admin-area/login

I realise I can probably disable the routes and manually register them, but there are quite a lot of routes so this seems like hard work. Is there an easier way?

0 likes
2 replies
Garet's avatar
Level 3

Thank you! I watched the video and it was as simple as adding 'prefix' => 'my-admin-area', to /config/fortify.php

Please or to participate in this conversation.