title: Laravel: how to avoid json on internal api call
body: <p>Laravel 4:  In the context of consume-your-own-api, my XyzController uses my custom InternalAPiDispatcher class to create a Request object, push it onto a stack (per <a href="https://stackoverflow.com/questions/16597420/how-can-i-access-query-string-parameters-for-requests-ive-manually-dispatched-i/16600493#comment23895495_16600493">this consideration</a>), then dispatch the Route:</p>
  
  <pre><code>class  InternalApiDispatcher {
  // ...
  public function dispatch($resource, $method)
  {
      $this-&gt;request = \Request::create($this-&gt;apiBaseUrl . '/' . $resource, $method);
      $this-&gt;addRequestToStack($this-&gt;request);
  
      return \Route::dispatch($this-&gt;request);
  }  
  </code></pre>
  
  <p>To start with, I'm working on a basic GET for a collection, and would like the Response content to be in the format of an Eloquent model, or whatever is ready to be passed to a View (perhaps a repository thingy later on when I get more advanced).  It seems inefficient to have the framework create a json response and then I decode it back into something else to display it in a view.  What is a simple/<em>efficient</em>/elegant way to direct the Request to return the Response in the format I desire wherever I am in my code?</p>
  
  <p>Also, I've looked at <a href="https://stackoverflow.com/questions/16597420/how-can-i-access-query-string-parameters-for-requests-ive-manually-dispatched-i/16600493#16600493">this post</a> a lot, and although I'm handling query string stuff in the BaseContorller (thanks to <a href="https://stackoverflow.com/questions/20321274/how-to-pass-query-string-params-to-routes-in-laravel4/20322441#20322441">this answer to my previous question</a>) it all seems to be getting far too convoluted and I feel I'm getting lost in the trees.</p>
  
  <p>EDIT:  could the following be relevant (from <a href="http://laravel.com/docs/templates" rel="nofollow noreferrer">laravel.com/docs/templates</a>)?</p>
  
  <blockquote>
    <p>"By specifying the layout property on the controller, the view specified will be created for you and will be <em>the assumed response that should be returned from actions</em>."</p>
  </blockquote>