title: Use laravel raw queries with dingo/APi + Fractal/transformers with laravel 5.1
body: <p>I have an ArticleCommentsController with an index method</p>
  
  <pre><code>class ArticleCommentsController extends BaseController
  {
      public function index($id)
      {
  
          $comments = DB::table('comments')
              -&gt;leftJoin('users', 'users.id', '=', 'comments.user_id')
              -&gt;where('comments.article_id', '=', $id)
              -&gt;get();
  
           return $this-&gt;response-&gt;item($comments, new CommentTransformer);
      }
  }
  </code></pre>
  
  <p>This is the transformer class</p>
  
  <pre><code>namespace App\Transformers;
  
  use League\Fractal\TransformerAbstract;
  
  class CommentTransformer extends TransformerAbstract{
      public function transform($comment)
      {
          return $comment; //simplified
      }
  }
  </code></pre>
  
  <p>The response is the following error:</p>
  
  <pre><code>get_class() expects parameter 1 to be object, array given.
  </code></pre>
  
  <p>Obviously, i need to send an instance of the comment object when calling Fractal\transform but i don't know how to do that since laravel's raw queries only return an array or an instance of the QueryBuilder class.</p>