title: How can I access query string parameters for requests I've manually dispatched in Laravel 4?
body: <p>I'm writing a simple API, and building a simple web application on top of this API. </p>
  
  <p>Because I want to "consume my own API" directly, I first Googled and found this answer on StackOverflow which answers my initial question perfectly: <a href="https://stackoverflow.com/questions/16520691/consuming-my-own-laravel-api">Consuming my own Laravel API</a></p>
  
  <p>Now, this works great, I'm able to access my API by doing something like:</p>
  
  <pre><code>$request = Request::create('/api/cars/'.$id, 'GET');
  $instance = json_decode(Route::dispatch($request)-&gt;getContent());
  </code></pre>
  
  <p>This is great! But, my API also allows you to add an optional <em>fields</em> parameter to the GET query string to specify specific attributes that should be returned, such as this:</p>
  
  <pre><code>http://cars.com/api/cars/1?fields=id,color
  </code></pre>
  
  <p>Now the way I actually handle this in the API is something along the lines of this:</p>
  
  <pre><code>public function show(Car $car)
  {
       if(Input::has('fields'))
       {
            //Here I do some logic and basically return only fields requested
            ....
       ...
   }
  </code></pre>
  
  <p>I would assume that I could do something similar as I did with the query string parameter-less approach before, something like this:</p>
  
  <pre><code>$request = Request::create('/api/cars/' . $id . '?fields=id,color', 'GET');
  $instance = json_decode(Route::dispatch($request)-&gt;getContent());
  </code></pre>
  
  <p>BUT, it doesn't seem so. Long story short, after stepping through the code it seems that the <code>Request</code> object is correctly created (and it correctly pulls out the <em>fields</em> parameter and assigns <em>id,color</em> to it), and the Route seems to be dispatched OK, but within my API controller itself I do not know how to access the <em>field</em> parameter. Using <code>Input::get('fields')</code> (which is what I use for "normal" requests) returns nothing, and I'm fairly certain that's because the static <code>Input</code> is referencing or scoping to the initial request the came in, NOT the new request I dispatched "manually" from within the app itself.</p>
  
  <p>So, my question is really how should I be doing this? Am I doing something wrong? Ideally I'd like to avoid doing anything ugly or special in my API controller, I'd like to be able to use Input::get for the internally dispatched requests and not have to make a second check , etc. </p>