title: Laravel 5.2 MethodNotAllowedHttpException in RouteCollection.php line 219
body: <p>First my error was Class Input not found so i added </p>
  
  <blockquote>
    <p>'Input' => Illuminate\Support\Facades\Input::class,</p>
  </blockquote>
  
  <p>in aliases array</p>
  
  <p>Now when i submit my form it gives this error</p>
  
  <blockquote>
    <p>ERROR:  MethodNotAllowedHttpException in RouteCollection.php line 219:</p>
  </blockquote>
  
  <p><strong>Routes.php</strong></p>
  
  <pre><code>Route::post('add', function () {
      $name = Input::get('name');
      if(DB::table('projects')-&gt;whereName($name)-&gt;first() != NULL) return 'already exist';
      DB::table('projects')-&gt;insert(array('name'=&gt;'$name'));
      return Redirect::to('/add'); 
  });
  </code></pre>
  
  <p><strong>welcome.blade.php :</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Laravel Learning&lt;/title&gt;
  &lt;/head&gt;
      &lt;body&gt;
              {!! Form::open(array('url' =&gt; 'add')) !!}
                  {!! Form::text('name', 'Your Name...') !!}
                  {!! Form::submit('Click Me!') !!}
              {!! Form::close() !!}   
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Error Snap:</strong>
  <a href="https://i.stack.imgur.com/bLj0C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bLj0C.png" alt="enter image description here"></a></p>