title: Fractal transformer with different Serializers for nested items and collections
body: <p>To change the JSON output send by a Laravel 5.4 RESTful API, I make use of the Fractal package by thephpleague. Because pagination will be added in the future, it is important that collections make use of the default DataArraySerializer  and single items use the ArraySerializer. It is also needed that deeper nested objects are given the same structure. How can I achieve this (globally or not)? </p>
  
  <pre><code>class TreeTransformer extends TransformerAbstract {
      protected $defaultIncludes = [
          'type',
          'branches'
      ];
  
      public function transform(Tree $tree) {
           return [
              'id' =&gt; (int)$tree-&gt;id,
              'name' =&gt; (string)$tree-&gt;name
          ];
      }
  
      public function includeType(Tree $tree) {
          return $this-&gt;item($tree-&gt;type, new TypeTransformer()); // Should be ArraySerializer  
      }
  
      public function includeBranches(Tree $tree) {
          return $this-&gt;collection($tree-&gt;branches, new BranchTransformer()); // Should stay DataArraySerializer  
      }
  }
  </code></pre>