2
Developing an application using Laravel 5.2, PHP7.0, Apache2 and Centos 7, I am having the following error: Methodnotallowedhttpexception.
On the local server it works normally... when I publish on the production server the error occurs, follow the screen:
I’m trying to reach (POST) the URL: /es/create
In the route archive:
Route::group(['prefix' => 'es'], function()
{
Route::group(['middleware' => 'auth'], function()
{
Route::post('create', 'SearchController@create');
});
});
View:
<h1>Create</h1>
<form method="POST" action="/es/create/" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<input type="text" name="index">
<button type="submit">CREATE</button>
</form>
I didn’t put the controller here because it doesn’t even get to the controller... stops on course.
I’ve tried without the enctype="application/x-www-form-urlencoded", according to some posts... but it didn’t work.
Someone would have a suggestion?
Thank you!
P.S.: I found several posts in English, but none with the solution I need.
Usually errors related to Methodnotallowedhttpexception give because of the program logic that is wrong. You have to correctly separate the POST and GET in your route file.
– Falion
@Falion thanks for the comment, however, didn’t help much... in the face of what you see that would be wrong? Because I’m at the beginning of development and it’s actually working on the local machine, which, in my opinion, the logic of the system is correct. Any comment on the code itself? At night I will do some tests on the server, because there are other systems running with Post enabled in Apache... But I’m finding the error very strange. Thanks for the comment again.
– Evert