Skip to content

Commit

Permalink
Fixed the problem of including data on transformer.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcc committed Aug 17, 2017
1 parent 23bb529 commit 6bcec1a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/Support/Transform.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
namespace App\Support;

use League\Fractal\Manager;
use App\Transformers\EmptyTransformer;
use League\Fractal\TransformerAbstract;
use Illuminate\Database\Eloquent\Collection;
use League\Fractal\Resource\Item as FractalItem;
use App\Transformers\EmptyTransformer;
use League\Fractal\Serializer\DataArraySerializer;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection as FractalCollection;
Expand All @@ -28,6 +29,12 @@ class Transform
public function __construct(Manager $fractal)
{
$this->fractal = $fractal;

if (request()->has('include')) {
$this->fractal->parseIncludes(request()->query('include'));
}

$this->fractal->setSerializer(new DataArraySerializer);
}

/**
Expand Down

1 comment on commit 6bcec1a

@jcc
Copy link
Owner Author

@jcc jcc commented on 6bcec1a Aug 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed #66

Please sign in to comment.