title: laravel ajax pass multiple variables to controller?
body: <p>I need to pass 4 variables to controller so that I can do what I want to do with it, however I get an error: </p>
  
  <blockquote>
    <p>Missing argument 1 for
    App\Http\Controllers\ProfileController::getGoogle()</p>
  </blockquote>
  
  <p>Here's my Controller:</p>
  
  <pre><code>function getGoogle($lat, $lng, $destinationLat, $destinationLng) {
      print_r($lat);
      print_r($lng);
      print_r($destinationLat);
      print_r($destinationLng);
  }
  </code></pre>
  
  <p>and ajax:</p>
  
  <pre><code>function getDirections(lat, lng, destinationLat, destinationLng) {
      $.ajax({
          url: '/google/',
          type: 'post',
          data: { 
              lat: lat,
              lng: lng,
              destinationLat: destinationLat,
              destinationLng: destinationLng
          },
          dataType: 'json',
          success: function() { alert('hello!'); },
          error: function() { alert('boo!'); },
          headers: {
              'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
          }
      });
  }
  </code></pre>
  
  <p>Route:</p>
  
  <pre><code>Route::post('google/', 'ProfileController@getGoogle');
  </code></pre>