Skip to content

Commit

Permalink
Use a map to prevent unnecessary array access (#32296)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga authored Apr 8, 2020
1 parent 1c6a504 commit 0347c51
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ public function toResponse($request)
),
$this->calculateStatus()
), function ($response) use ($request) {
$response->original = $this->resource->resource->pluck('resource');
$response->original = $this->resource->resource->map(function ($item) {
return $item->resource;
});

$this->resource->withResponse($request, $response);
});
Expand Down

0 comments on commit 0347c51

Please sign in to comment.