title: Laravel encode/decode ajax url
body: <p>Controller:</p>
  
  <pre><code>public function ajaxsearch(Request $request)
      {
          if ($request-&gt;ajax()) {
              $output = "";
              $productindex = Product::where('product_name', 'LIKE', '%' . $request-&gt;states . '%')-&gt;take(4)-&gt;get();
  
              if ($productindex) {
                  foreach ($productindex as $key =&gt; $value) {
                      $output .= '&lt;div&gt;
                                  &lt;img src="/images/'. $value-&gt;slidephoto-&gt;first()-&gt;sm_photo .'.jpg" width="400px"&gt;
                                  &lt;h3&gt;'. $value-&gt;product_name .'&lt;/h3&gt;
                                  &lt;/div&gt;';
                  }
                  return Response($output);
              }
          }
          return view('main.ajax');
      }
  </code></pre>
  
  <p>jquery:</p>
  
  <pre><code>$('#searchinput').on('keyup', function(){
        $value=$(this).val();
        $.ajax({
          type: 'get',
          url: '{{URL::to('ajaxsearch')}}',
          data: {'states':$value},
          success:function(data){
            $('#fixedsearch').html(data);
  
          }
        });
      });
  </code></pre>
  
  <p>When ajax fetches a value which is not in english I get this problem in my console log.</p>
  
  <pre><code>191.js:5 GET http://localhost:8000/ajaxsearch?states=%CF%80 500 (Internal Server Error)
  </code></pre>
  
  <p>I am using Laravel 5.1 and jquery v. 1.9.1.
  The foreign language I use as additional is the Greek that I have this specific problem.</p>