MethodNotAllowedHttpException in RouteCollection.php line 218
<p>i'm new to laravel, and i found few decent tutorials to help me understand and get started with it.<br>
the problem is-> whenever i want to use the post method this exception raises <code>MethodNotAllowedHttpException</code><br>but  unlike, maybe 99% of who asked similar questions, in my case it says the exception is <code>in RouteCollection.php line 218</code>, which is unusual but not to <code>laravel 5.2.x</code></p>

<p>the following is the methode post in routes.php:</p>

<pre><code>Route::post('/ajouter_produit', 
[
    'uses'=&gt;'ProductController@addProduct',
    'as'=&gt;'ajouter_produit',
]);
</code></pre>

<p>i even tried adding this method to a middleware route group but the problem remained.
<br><br>
this is my controller:</p>

<pre><code>public function addProduct (Request $request)
{

    $this-&gt;validate($request, [
        'label'=&gt;'required|alpha',
        'prix'=&gt;'required|numeric',
    ]);

    $prod = new Product();
    $prod-&gt;label=$request['label'];
    $prod-&gt;type=$request['type'];
    $prod-&gt;prix=$request['prix'];

    $prod-&gt;save();

    return view('welcome');

}
</code></pre>

<p>and this is my form: </p>

<pre><code>&lt;form action="{{ route('ajouter_produit') }}" method="post" &gt;

    &lt;input type="text" name="label" id="label"/&gt;

    &lt;select name="type" id="type"&gt;
        &lt;option value="1"&gt;Par unité&lt;/option&gt;
        &lt;option value="2" selected&gt;Par kilo&lt;/option&gt;
    &lt;/select&gt;

    &lt;input type="text" name="prix" id="prix"/&gt;

    &lt;button type="submit"&gt;Ajouter&lt;/button&gt;

    &lt;input type="hidden" value="{{ Session::token() }}" name="_token"/&gt;
</code></pre>

<p></p>

<p>i also tried this but it raised the same problem:</p>

<pre><code>Route::post('/trypost', function () {
    return 'hello post';
});
</code></pre>

<p>can you please help me !!</p>

<p>if you need any other source just ask for it. <br>
Every effort will be much appreciated. <strong><em>thank you</em></strong></p>