title: Laravel 5.1 ajax not working?
body: <p>i am trying to submit login form using ajax in laravel but it seems to be ajax part not working. below is my login.blade.php</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  
  &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"&gt;
  &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"&gt;&lt;/script&gt; 
  
  &lt;/head&gt;
  &lt;body&gt;
  
  
  &lt;div class="secure"&gt;Secure Login form&lt;/div&gt;
  {!! Form::open(array('url'=&gt;'account/login','method'=&gt;'POST', 'id'=&gt;'myform')) !!}
  &lt;div class="control-group"&gt;
    &lt;div class="controls"&gt;
       {!! Form::text('email','',array('id'=&gt;'','class'=&gt;'form-control span6','placeholder' =&gt; 'Email')) !!}
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="control-group"&gt;
    &lt;div class="controls"&gt;
    {!! Form::password('password',array('class'=&gt;'form-control span6', 'placeholder' =&gt; 'Please Enter your Password')) !!}
    &lt;/div&gt;
  &lt;/div&gt;
  {!! Form::button('Login', array('class'=&gt;'send-btn')) !!}
  {!! Form::close() !!}
  
  
  
  &lt;script type="text/javascript"&gt;
  $(document).ready(function(){
    $('.send-btn').click(function(){ 
  $val=$('input[name=email]').val();  
  $token=$('input[name=_token]').val();
  //alert($val+$token);
     $.ajax({
        url: '/account/login',
        type: "post",
  
        data: {'email':$('input[name=email]').val(), '_token': $('input[name=_token]').val()},
        success: function(data){
          alert(data);
        }
      });  
  
  
    }); 
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>route.php</p>
  
  <pre><code>Route::get('account/login', function() {
    return View::make('login');
  });
  Route::post('account/login', 'AccountController@login');
  </code></pre>
  
  <p>in controller</p>
  
  <pre><code> public function login() {
  
      if(Request::ajax()) {
        $data = Input::all();
        print_r($data);
  
        die;
      }
  
      }
  </code></pre>
  
  <p>I have tried to alert input values in ajax part before success, it will print output but success alert wont work.</p>