Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
amirfaramarzi committed Jul 8, 2021
1 parent 670813e commit 8cc8205
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/JsonResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@ public function __construct(Collection|Paginator|stdClass|array|null $data , int
$this->perPage = $perPage;
}

public function reletional(): array
public function dontJson(): array|null
{
$this->process();
if (is_null($this->data))
return null;

if ($this->data instanceof stdClass)
return $this->toArray($this->data);

$this->process();
return $this->response;
}

Expand Down

0 comments on commit 8cc8205

Please sign in to comment.