@@ -67,7 +67,7 @@ |
||
| 67 | 67 | $keys = []; |
| 68 | 68 | |
| 69 | 69 | foreach ($models as $model) { |
| 70 | - if (! is_null($value = ModelAccessor::get($model, $this->foreignKey))) { |
|
| 70 | + if (!is_null($value = ModelAccessor::get($model, $this->foreignKey))) { |
|
| 71 | 71 | $keys[] = $value; |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | */ |
| 64 | 64 | protected function getKeys(array $models, $key = null) |
| 65 | 65 | { |
| 66 | - return array_unique(array_values(array_map(function ($value) use ($key) { |
|
| 66 | + return array_unique(array_values(array_map(function($value) use ($key) { |
|
| 67 | 67 | return $key ? ModelAccessor::get($value, $key) : ModelAccessor::get($value, $this->parent->getKeyName()); |
| 68 | 68 | }, $models))); |
| 69 | 69 | } |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | { |
| 130 | 130 | $foreign = $this->foreignKey; |
| 131 | 131 | |
| 132 | - return collect($this->dictionary[$type])->map(function ($models) use ($foreign) { |
|
| 132 | + return collect($this->dictionary[$type])->map(function($models) use ($foreign) { |
|
| 133 | 133 | return ModelAccessor::get(head($models), $foreign); |
| 134 | 134 | })->values()->unique(); |
| 135 | 135 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | if (count($result) == count(array_unique($id))) { |
| 67 | 67 | return $result; |
| 68 | 68 | } |
| 69 | - } elseif (! is_null($result)) { |
|
| 69 | + } elseif (!is_null($result)) { |
|
| 70 | 70 | return $result; |
| 71 | 71 | } |
| 72 | 72 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function firstSimpleOrFail($columns = ['*']) |
| 98 | 98 | { |
| 99 | - if (! is_null($model = $this->firstSimple($columns))) { |
|
| 99 | + if (!is_null($model = $this->firstSimple($columns))) { |
|
| 100 | 100 | return $model; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | if ($this->isSimple()) { |
| 94 | 94 | $this->query->addSelect($this->shouldSelect($columns)); |
| 95 | 95 | |
| 96 | - return tap($this->query->paginate($perPage, $columns, $pageName, $page), function ($paginator) { |
|
| 96 | + return tap($this->query->paginate($perPage, $columns, $pageName, $page), function($paginator) { |
|
| 97 | 97 | $items = $paginator->items(); |
| 98 | 98 | |
| 99 | 99 | $this->hydrateSimplePivotRelation($items); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | { |
| 117 | 117 | if ($this->isSimple()) { |
| 118 | 118 | $this->query->addSelect($this->shouldSelect($columns)); |
| 119 | - return tap($this->query->simplePaginate($perPage, $columns, $pageName, $page), function ($paginator) { |
|
| 119 | + return tap($this->query->simplePaginate($perPage, $columns, $pageName, $page), function($paginator) { |
|
| 120 | 120 | $items = $paginator->items(); |
| 121 | 121 | |
| 122 | 122 | $this->hydrateSimplePivotRelation($items); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | $this->query->addSelect($this->shouldSelect()); |
| 142 | 142 | |
| 143 | - return $this->query->chunk($count, function ($results) use ($callback) { |
|
| 143 | + return $this->query->chunk($count, function($results) use ($callback) { |
|
| 144 | 144 | $items = $results->all(); |
| 145 | 145 | |
| 146 | 146 | $this->hydrateSimplePivotRelation($items); |
@@ -170,8 +170,8 @@ |
||
| 170 | 170 | * @return MorphToMany |
| 171 | 171 | */ |
| 172 | 172 | protected function newMorphToMany(Builder $query, Model $parent, $name, $table, $foreignPivotKey, |
| 173 | - $relatedPivotKey, $parentKey, $relatedKey, |
|
| 174 | - $relationName = null, $inverse = false) |
|
| 173 | + $relatedPivotKey, $parentKey, $relatedKey, |
|
| 174 | + $relationName = null, $inverse = false) |
|
| 175 | 175 | { |
| 176 | 176 | return new MorphToMany($query, $parent, $name, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, |
| 177 | 177 | $relationName, $inverse); |