diff --git a/src/Services/Response.php b/src/Services/Response.php index 4c663683..f87395c3 100644 --- a/src/Services/Response.php +++ b/src/Services/Response.php @@ -6,7 +6,6 @@ use Apiato\Core\Contracts\HasResourceKey; use Illuminate\Http\JsonResponse; use League\Fractal\Scope; -use League\Fractal\Serializer\SerializerAbstract; use League\Fractal\TransformerAbstract; use Spatie\Fractal\Fractal; use Spatie\Fractalistic\Exceptions\NoTransformerSpecified; @@ -31,29 +30,6 @@ public static function getRequestedIncludes(): array return static::create()->manager->parseIncludes($requestedIncludes)->getRequestedIncludes(); } - /** - * Create a new Response instance. - * - * @param mixed|null $data - * @param callable|TransformerAbstract|string|null $transformer - * @param SerializerAbstract|string|null $serializer - */ - public static function create($data = null, $transformer = null, $serializer = null): static - { - $response = parent::create($data, $transformer, $serializer); - - $response->parseFieldsets(self::getRequestedFieldsets()); - - return $response; - } - - private static function getRequestedFieldsets(): array - { - $requestKey = config('apiato.requests.sparse_fieldsets.request_key'); - - return request()?->input($requestKey) ?? []; - } - public function createData(): Scope { $this->withResourceName($this->defaultResourceName());