@@ 54-60 (lines=7) @@ | ||
51 | * @param null $resourceKey |
|
52 | * @return \Illuminate\Http\JsonResponse |
|
53 | */ |
|
54 | protected function respondWithItem($item, $callback = null, $resourceKey = null) |
|
55 | { |
|
56 | $rootScope = $this->fractal |
|
57 | ->item($item, $callback, $resourceKey); |
|
58 | ||
59 | return $this->respondWithArray($rootScope->toArray()); |
|
60 | } |
|
61 | ||
62 | /** |
|
63 | * Returns a json response that contains the specified collection |
@@ 92-98 (lines=7) @@ | ||
89 | * @param null $resourceKey |
|
90 | * @return \Illuminate\Http\JsonResponse |
|
91 | */ |
|
92 | protected function respondWithItemCreated($item, $callback = null, $resourceKey = null) |
|
93 | { |
|
94 | $this->setStatusCode(201); |
|
95 | $rootScope = $this->fractal->item($item, $callback, $resourceKey); |
|
96 | ||
97 | return $this->respondWithArray($rootScope->toArray()); |
|
98 | } |
|
99 | ||
100 | /** |
|
101 | * Returns a json response that contains the specified collection |