@@ -98,7 +98,7 @@ |
||
| 98 | 98 | */ |
| 99 | 99 | protected function hasOneOrManyDeepThroughParents(array $through): array |
| 100 | 100 | { |
| 101 | - return array_map(function ($class) { |
|
| 101 | + return array_map(function($class) { |
|
| 102 | 102 | $segments = preg_split('/\s+(as|from)\s+/i', $class, -1, PREG_SPLIT_DELIM_CAPTURE); |
| 103 | 103 | |
| 104 | 104 | $instance = Str::contains($segments[0], '\\') |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | * @param string $prefix |
| 119 | 119 | * @return void |
| 120 | 120 | */ |
| 121 | - protected function joinThroughParent(Builder $query, Model $throughParent, Model $predecessor, array|string $foreignKey, array|string $localKey, string $prefix): void |
|
| 121 | + protected function joinThroughParent(Builder $query, Model $throughParent, Model $predecessor, array | string $foreignKey, array | string $localKey, string $prefix): void |
|
| 122 | 122 | { |
| 123 | 123 | if (is_array($localKey)) { |
| 124 | 124 | $query->where($throughParent->qualifyColumn($localKey[0]), '=', $predecessor->getMorphClass()); |
@@ -139,9 +139,9 @@ discard block |
||
| 139 | 139 | $query->join($throughParent->getTable(), $first, '=', $second); |
| 140 | 140 | |
| 141 | 141 | if ($this->throughParentInstanceSoftDeletes($throughParent)) { |
| 142 | - $column= $throughParent->getQualifiedDeletedAtColumn(); |
|
| 142 | + $column = $throughParent->getQualifiedDeletedAtColumn(); |
|
| 143 | 143 | |
| 144 | - $query->withGlobalScope(__CLASS__ . ":$column", function (Builder $query) use ($column) { |
|
| 144 | + $query->withGlobalScope(__CLASS__.":$column", function(Builder $query) use ($column) { |
|
| 145 | 145 | $query->whereNull($column); |
| 146 | 146 | }); |
| 147 | 147 | } |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | $this->query->addSelect($columns); |
| 209 | 209 | |
| 210 | - return tap($this->query->paginate($perPage, $columns, $pageName, $page), function (Paginator $paginator) { |
|
| 210 | + return tap($this->query->paginate($perPage, $columns, $pageName, $page), function(Paginator $paginator) { |
|
| 211 | 211 | $this->hydrateIntermediateRelations($paginator->items()); |
| 212 | 212 | }); |
| 213 | 213 | } |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | |
| 230 | 230 | $this->query->addSelect($columns); |
| 231 | 231 | |
| 232 | - return tap($this->query->simplePaginate($perPage, $columns, $pageName, $page), function (Paginator $paginator) { |
|
| 232 | + return tap($this->query->simplePaginate($perPage, $columns, $pageName, $page), function(Paginator $paginator) { |
|
| 233 | 233 | $this->hydrateIntermediateRelations($paginator->items()); |
| 234 | 234 | }); |
| 235 | 235 | } |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | |
| 252 | 252 | $this->query->addSelect($columns); |
| 253 | 253 | |
| 254 | - return tap($this->query->cursorPaginate($perPage, $columns, $cursorName, $cursor), function (CursorPaginator $paginator) { |
|
| 254 | + return tap($this->query->cursorPaginate($perPage, $columns, $cursorName, $cursor), function(CursorPaginator $paginator) { |
|
| 255 | 255 | $this->hydrateIntermediateRelations($paginator->items()); |
| 256 | 256 | }); |
| 257 | 257 | } |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | */ |
| 277 | 277 | public function chunk($count, callable $callback): bool |
| 278 | 278 | { |
| 279 | - return $this->prepareQueryBuilder()->chunk($count, function (Collection $results) use ($callback) { |
|
| 279 | + return $this->prepareQueryBuilder()->chunk($count, function(Collection $results) use ($callback) { |
|
| 280 | 280 | $this->hydrateIntermediateRelations($results->all()); |
| 281 | 281 | |
| 282 | 282 | return $callback($results); |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | ); |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | - $table = $throughParent->getTable() . ' as ' . $this->getRelationCountHash(); |
|
| 310 | + $table = $throughParent->getTable().' as '.$this->getRelationCountHash(); |
|
| 311 | 311 | |
| 312 | 312 | $throughParent->setTable($table); |
| 313 | 313 | |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | foreach ($columns as $column) { |
| 373 | - $this->query->withoutGlobalScope(__CLASS__ . ":$column"); |
|
| 373 | + $this->query->withoutGlobalScope(__CLASS__.":$column"); |
|
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | return $this; |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | * @param string|null $accessor |
| 24 | 24 | * @return $this |
| 25 | 25 | */ |
| 26 | - public function withIntermediate(string $class, array $columns = ['*'], string|null $accessor = null): self |
|
| 26 | + public function withIntermediate(string $class, array $columns = ['*'], string | null $accessor = null): self |
|
| 27 | 27 | { |
| 28 | 28 | /** @var \Illuminate\Database\Eloquent\Model $instance */ |
| 29 | 29 | $instance = new $class(); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * @param string|null $accessor |
| 43 | 43 | * @return $this |
| 44 | 44 | */ |
| 45 | - public function withPivot(string $table, array $columns = ['*'], string $class = Pivot::class, string|null $accessor = null): self |
|
| 45 | + public function withPivot(string $table, array $columns = ['*'], string $class = Pivot::class, string | null $accessor = null): self |
|
| 46 | 46 | { |
| 47 | 47 | if ($columns === ['*']) { |
| 48 | 48 | $columns = $this->query->getConnection()->getSchemaBuilder()->getColumnListing($table); |