In such case you will need to create a middleware.
Please checkout this answer on Laracasts https://laracasts.com/discuss/channels/general-discussion/middleware-on-specific-methods
Also, 404 is Page Not Found and 403 is forbidden.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello, after sign up i am redirecting page from my code to verifyotp route. in url it's showing "https://www.page.com/verifyotp " now verifyotp is my route name. is there is any way to stop it if some one trying it by typing in url query string i want to show it 404 forbidden . i do not know i make you understand my question or not? but i just want if user manually trying put my route name in url they always got 404 forbidden page. is this possible ?
Please or to participate in this conversation.