Passed
Push — relationships ( 489f2c...b6e256 )
by Alex
03:59 queued 01:21
created
src/Http/Controllers/JsonApiController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         $record = $record instanceof Model ? $record : $this->findModelInstance($record);
172 172
         $data = (array) $request->input('data');
173 173
 
174
-        $record->update([($foreignKey ?: $relation . '_id') => $data['id']]);
174
+        $record->update([($foreignKey ?: $relation.'_id') => $data['id']]);
175 175
 
176 176
         return new JsonApiResponse();
177 177
     }
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
     protected function getRequestParameters($request)
239 239
     {
240 240
         return [
241
-            'fields' => $this->getRequestQuerySet($request, 'fields.' . $this->getModelType()),
241
+            'fields' => $this->getRequestQuerySet($request, 'fields.'.$this->getModelType()),
242 242
             'include' => $this->getRequestQuerySet($request, 'include'),
243 243
             'sort' => $this->getRequestQuerySet($request, 'sort'),
244 244
             'filter' => (array) $request->input('filter'),
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
      */
320 320
     protected function transformCollection($records, array $fields = [])
321 321
     {
322
-        $data = $records->map(function ($record) {
322
+        $data = $records->map(function($record) {
323 323
             return $this->transformRecord($record, $fields)['data'];
324 324
         });
325 325
 
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
      */
337 337
     protected function transformCollectionIds($records)
338 338
     {
339
-        $data = $records->map(function ($record) {
339
+        $data = $records->map(function($record) {
340 340
             return [
341 341
                 'type' => $record->getTable(),
342 342
                 'id' => $record->id,
Please login to merge, or discard this patch.