title: How to pass array of data to controller?
body: <p>I'm new here :). I have a problem with my code. I'm working with laravel 5.1 and Blade. In my view I have:</p>
  
  <pre><code>function getNumber(){
        values = [];
        values[0] = $('#receipt_type_id').val();
        values[1] = $('#provider_id').val();
        $.ajax({
            url: "{{{ url('receipts/showByNumber') }}}",            
            type: "get",              
            data: {ids: values},              
            dataType: "json",
            success: function (data) {
                //i do something
            }                  
        });
    }
  </code></pre>
  
  <p>In my route:</p>
  
  <pre><code>Route::get('receipts/showByNumber', ['as' =&gt; 'receipt.showByNumber', 'uses' =&gt; 'ReceiptsController@showByNumber']);
  </code></pre>
  
  <p>And in my controller:</p>
  
  <pre><code>public function showByNumber($values){        
      $receipt_type_id = $values[0];
      $provider_id = $values[1];
      //Find the receipt to edit
      ...
      ...            
  }
  </code></pre>
  
  <p>The error is <code>GET http://manchego.app/receipts/showByNumber?ids%5B%5D=1&amp;ids%5B%5D=2 500 (Internal Server Error)</code>. I read another topics with the same problem that I have but I can't understand where is my problem.</p>
  
  <p>Thanks in advance! :)</p>