title: jquery .ajax function not working properly with Laravel-4
body: <p>what I am trying to do is to pass a variable from my view to a controller function..The problem is that I am never routed to my controller's function store.So I cant check if I get the variable as well. The ajax function seems to work(the alert is displayed) but I never get the message success from my controller..</p>
  
  <p>So far my route file is : </p>
  
  <pre><code>Route::get('pois', array(
      'uses' =&gt; 'MapController@create',
      'as' =&gt; 'pois.create'
      ));
  
  Route::post('pois', array(
      'uses' =&gt; 'MapController@store',
      'as' =&gt; 'pois.get'
      ));
  </code></pre>
  
  <p>My MapController is: </p>
  
  <pre><code>public function create()
  {
  
      $bar=new Map;
      $rest=new Map;
      $mag=new Map;
  
      $bar = Map::where('type', '=', 'bar')-&gt;take(10)-&gt;get();
      $rest = Map::where('type', '=', 'restaurant')-&gt;take(10)-&gt;get();
      $mag = Map::where('type', '=', 'magazine')-&gt;take(10)-&gt;get();
  
      return View::make('pois.markers')-&gt;with('bar',$bar)-&gt;with('rest',$rest)-&gt;with('mag',$mag);
  
  }
  
  /**
   * Store a newly created resource in storage.
   *
   * @return Response
   */
  public function store()
  {
      dd('suceess');
  
  }
  </code></pre>
  
  <p>And my javascript-jquery script is bellow:</p>
  
  <pre><code>function ajaxCall(id) {
  
  
  
         $.ajax
          ({
                  type: "POST",
                  url: "pois",
                  data: {"id" : id}, 
                  success: function(response)
                    { 
                      alert('ok');
                    }
          });
  }
  
  
  
  function checkBoxes(elem){
  
  if(document.getElementById(elem).checked==true){
  
    ajaxCall(elem); 
  
  }
  else{
  
  clearMarkers(elem);
  
  }
  
  }
  </code></pre>
  
  <p>Bellow is my HTML as well : </p>
  
  <pre><code>@section('main_contents')
  
      &lt;br/&gt;
  
      &lt;div class="text-center"&gt;
  
  
  
  
  
  &lt;label class="checkbox-inline"&gt;
    &lt;input type="checkbox" id="bar" name="group" value="option1" onClick="checkBoxes(this.id)"&gt; Καφετέριες
  &lt;/label&gt;
  &lt;label class="checkbox-inline"&gt;
    &lt;input type="checkbox" id="restaurant" name="group"  value="option2" onClick="checkBoxes(this.id)"&gt; Εστιατόρια
  &lt;/label&gt;
  &lt;label class="checkbox-inline"&gt;
    &lt;input type="checkbox" id="magazine" name="group"  value="option3" onClick="checkBoxes(this.id)"&gt; Μαγαζιά
  &lt;/label&gt;
  
  
  
  &lt;br/&gt;
  
  &lt;/div&gt;
  
       &lt;div id="map" style="height:500px;"&gt;&lt;/div&gt;
  
       @stop
  </code></pre>