title: Get parameter from ajax to controller Laravel
body: <p>I want to pass value of id to controller in Laravel</p>
  
  <p>my Ajax Code:</p>
  
  <pre><code>$(document).ready(function () {
  
  
              $(document).on('click', '.brnch_clk', function () {
                  //alert('ok')
                  var branchid = $(this).data('branch');
                  $('#txt_branchid').val(branchid);
                  alert($(this).data('branch'));
  
                  $.ajax({
                      'url': 'search',
                      'type': 'GET',
                      'data': {id: branchid},
  
                      success: function(response){ // What to do if we succeed
                          if(data == "success")
                              alert(response);
                      },
                      error: function(response){
                          alert('Error'+response);
                      }
  
  
  
                  });
              });
  
          });
  </code></pre>
  
  <p>My Controller:</p>
  
  <pre><code>public function search(Request $request)
  {
      $member = $request-&gt;get('id');
      return json_encode($member);
  }
  </code></pre>
  
  <p>My Route:</p>
  
  <pre><code>Route::get('search', 'ShowstaffController@search');
  </code></pre>
  
  <p>My Link:</p>
  
  <pre><code>&lt;a href="{{URL('search')}}" class="brnch_clk"
      data-branch="{{$value-&gt;branch_id}}"&gt; {{$value-&gt;Branch_Name}}
  &lt;/a&gt;
  </code></pre>
  
  <p>How can i get parametter id from ajax to controller??</p>