@@ -83,7 +83,7 @@ public function paginator(AbstractPaginator|AbstractCursorPaginator $resource):
8383 {
8484 return [
8585 'data ' => $ resource ->toArray ()['data ' ],
86- 'meta ' => $ this ->formatMeta ($ resource )
86+ 'meta ' => $ this ->formatMeta ($ resource ),
8787 ];
8888 }
8989
@@ -97,7 +97,7 @@ public function resourceCollection(ResourceCollection $collection): array
9797 {
9898 return array_filter ([
9999 'data ' => $ collection ->toArray (request ()),
100- 'meta ' => $ this ->formatMeta ($ collection ->resource )
100+ 'meta ' => $ this ->formatMeta ($ collection ->resource ),
101101 ]);
102102 }
103103
@@ -109,7 +109,7 @@ public function resourceCollection(ResourceCollection $collection): array
109109 */
110110 public function jsonResource (JsonResource $ resource ): array
111111 {
112- return value ($ this ->formatJsonResource (),$ resource );
112+ return value ($ this ->formatJsonResource (), $ resource );
113113 }
114114
115115 /**
@@ -121,7 +121,7 @@ public function jsonResource(JsonResource $resource): array
121121 */
122122 protected function formatMessage (int $ code , ?string $ message ): ?string
123123 {
124- if (!$ message && class_exists ($ enumClass = Config::get ('response.enum ' ))) {
124+ if (! $ message && class_exists ($ enumClass = Config::get ('response.enum ' ))) {
125125 $ message = $ enumClass ::fromValue ($ code )->description ;
126126 }
127127
@@ -185,7 +185,7 @@ protected function formatMeta($collection)
185185 'prev ' => $ collection ->previousCursor ()?->encode(),
186186 'next ' => $ collection ->nextCursor ()?->encode(),
187187 'count ' => count ($ collection ->items ()),
188- ]
188+ ],
189189 ],
190190 $ collection instanceof LengthAwarePaginator => [
191191 'pagination ' => [
@@ -226,7 +226,7 @@ protected function formatDataFields(array $data): array
226226 $ formatConfig = \config ('response.format.config ' , []);
227227
228228 foreach ($ formatConfig as $ key => $ config ) {
229- if (!Arr::has ($ data , $ key )) {
229+ if (! Arr::has ($ data , $ key )) {
230230 continue ;
231231 }
232232
@@ -239,7 +239,7 @@ protected function formatDataFields(array $data): array
239239 $ key = $ alias ;
240240 }
241241
242- if (!$ show ) {
242+ if (! $ show ) {
243243 $ data = Arr::except ($ data , $ key );
244244 }
245245 }
0 commit comments