title: Laravel post form error
body: <p>I'm having a problem for the first time when i submit a form.</p>
  
  <p>When i submit the form it doesn't go to post route and i don't know why.</p>
  
  <p>my post route is that:</p>
  
  <pre><code>    Route::post('/app/add-new-db', function()
    {
      $rules = array(
            'name' =&gt; 'required|min:4',
            'file' =&gt; 'required'
      );
  
      $validator = Validator::make(Input::all(), $rules);
      if ($validator-&gt;fails()) {
  
        // get the error messages from the validator
        $messages = $validator-&gt;messages();
  
        // redirect our user back to the form with the errors from the validator
        return Redirect::to('app/add-new-db')
           -&gt;withErrors($validator);
  
       }
       else
       {
          $name = Input::get('name');
          $fname = pathinfo(Input::file('file')-&gt;getClientOriginalName(), PATHINFO_FILENAME);
          $fext = Input::file('file')-&gt;getClientOriginalExtension();
          echo $fname.$fext;
          //Input::file('file')-&gt;move(base_path() . '/public/dbs/', $fname.$fext);
  
          /*
          DB::connection('mysql')-&gt;insert('insert into databases (name, logotipo) values (?, ?)',
           [$name, $fname.$fext]);
           */
         //return Redirect::to('app/settings/');
       }
    });
  </code></pre>
  
  <p>And my html:</p>
  
  <pre><code>    &lt;div class="mdl-cell mdl-cell--12-col content"&gt;
    {!! Form::open(['url'=&gt;'app/add-new-db', 'files'=&gt;true]) !!}
    &lt;div class="mdl-grid no-verticall"&gt;
      &lt;div class="mdl-cell mdl-cell--12-col"&gt;
        &lt;h4&gt;Adicionar Base de Dados&lt;/h4&gt;
        &lt;div class="divider"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="mdl-cell mdl-cell--6-col"&gt;
        &lt;div class="form-group"&gt;
          {!! Form::label('name', 'Nome: ') !!}
          {!! Form::text('name', null, ['id'=&gt; 'name', 'class' =&gt; 'form-control']) !!}
        &lt;/div&gt;
        &lt;div class="form-group"&gt;
          {!! Form::label('image', 'Logotipo:') !!}
          {!! Form::file('image', ['class'=&gt;'form-control']) !!}
          @if ($errors-&gt;has('image'))
            &lt;span class="error"&gt;{{ $errors-&gt;first('image') }}&lt;/span&gt;
          @endIf
        &lt;/div&gt;
        &lt;div class="form-group"&gt;
          {!! Form::submit('Adicionar', ['id'=&gt;'add-new-db', 'class'=&gt;'btn btn-default']) !!}
          &lt;p class="text-success"&gt;&lt;?php echo Session::get('success'); ?&gt;&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    {!! Form::close() !!}
  &lt;/div&gt;
  </code></pre>
  
  <p>I'm loading this from from a jquery get:</p>
  
  <pre><code>    function addDB()
     {
       $( "#settings-new-db" ).click(function(e)
       {
         $.get('/app/add-new-db', function(response)
         {
            $('.content-settings').html("");
            $('.content-settings').html(response);
            componentHandler.upgradeDom();
         });
         e.preventDefault();
       });
     }
  </code></pre>
  
  <p>When i try to submit the form i'm getting 302 found in network console from chrome.</p>
  
  <p>I'm doing forms at this way and it is happens for the first time. Anyone can help me?</p>
  
  <p>Thanks</p>