When directly accessing a URL which use Route::post(), Laravel shows the following 405 Method Not Allowed error screen:
Oops! An Error Occurred The server returned a "405 Method Not Allowed". Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.
I think it is not good to give bad people information about the correct method. Am I right?
How to hide 405 Method Not Allowed error screen and show 404 Not Found error instead?
It is better to configure .env or Laravel than to configure nginx or apache. And I don't want to write 404 error redirect in every controller methods.
I want to hide the error screen only in the production because it is good to know that method is not correct while developing (debug mode is on).