@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | $query->join( |
| 167 | 167 | $throughParent->getTable(), |
| 168 | - function (JoinClause $join) use ($joins) { |
|
| 168 | + function(JoinClause $join) use ($joins) { |
|
| 169 | 169 | foreach ($joins as [$first, $second]) { |
| 170 | 170 | $join->on($first, '=', $second); |
| 171 | 171 | } |
@@ -173,9 +173,9 @@ discard block |
||
| 173 | 173 | ); |
| 174 | 174 | |
| 175 | 175 | if ($this->throughParentInstanceSoftDeletes($throughParent)) { |
| 176 | - $column= $throughParent->getQualifiedDeletedAtColumn(); |
|
| 176 | + $column = $throughParent->getQualifiedDeletedAtColumn(); |
|
| 177 | 177 | |
| 178 | - $query->withGlobalScope(__CLASS__ . ":$column", function (Builder $query) use ($column) { |
|
| 178 | + $query->withGlobalScope(__CLASS__.":$column", function(Builder $query) use ($column) { |
|
| 179 | 179 | $query->whereNull($column); |
| 180 | 180 | }); |
| 181 | 181 | } |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | |
| 266 | 266 | $this->query->addSelect($columns); |
| 267 | 267 | |
| 268 | - return tap($this->query->paginate($perPage, $columns, $pageName, $page), function (Paginator $paginator) { |
|
| 268 | + return tap($this->query->paginate($perPage, $columns, $pageName, $page), function(Paginator $paginator) { |
|
| 269 | 269 | $this->hydrateIntermediateRelations($paginator->items()); |
| 270 | 270 | }); |
| 271 | 271 | } |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | |
| 289 | 289 | $this->query->addSelect($columns); |
| 290 | 290 | |
| 291 | - return tap($this->query->simplePaginate($perPage, $columns, $pageName, $page), function (Paginator $paginator) { |
|
| 291 | + return tap($this->query->simplePaginate($perPage, $columns, $pageName, $page), function(Paginator $paginator) { |
|
| 292 | 292 | $this->hydrateIntermediateRelations($paginator->items()); |
| 293 | 293 | }); |
| 294 | 294 | } |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | |
| 312 | 312 | $this->query->addSelect($columns); |
| 313 | 313 | |
| 314 | - return tap($this->query->cursorPaginate($perPage, $columns, $cursorName, $cursor), function (CursorPaginator $paginator) { |
|
| 314 | + return tap($this->query->cursorPaginate($perPage, $columns, $cursorName, $cursor), function(CursorPaginator $paginator) { |
|
| 315 | 315 | $this->hydrateIntermediateRelations($paginator->items()); |
| 316 | 316 | }); |
| 317 | 317 | } |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | */ |
| 346 | 346 | public function chunk($count, callable $callback) |
| 347 | 347 | { |
| 348 | - return $this->prepareQueryBuilder()->chunk($count, function (Collection $results) use ($callback) { |
|
| 348 | + return $this->prepareQueryBuilder()->chunk($count, function(Collection $results) use ($callback) { |
|
| 349 | 349 | $this->hydrateIntermediateRelations($results->all()); |
| 350 | 350 | |
| 351 | 351 | return $callback($results); |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | ); |
| 377 | 377 | } |
| 378 | 378 | |
| 379 | - $table = $throughParent->getTable() . ' as ' . $this->getRelationCountHash(); |
|
| 379 | + $table = $throughParent->getTable().' as '.$this->getRelationCountHash(); |
|
| 380 | 380 | |
| 381 | 381 | $throughParent->setTable($table); |
| 382 | 382 | |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | foreach ($columns as $column) { |
| 444 | - $this->query->withoutGlobalScope(__CLASS__ . ":$column"); |
|
| 444 | + $this->query->withoutGlobalScope(__CLASS__.":$column"); |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | return $this; |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $related = get_class($relation->getRelated()); |
| 70 | 70 | |
| 71 | 71 | if ((new $related())->getTable() !== $relation->getRelated()->getTable()) { |
| 72 | - $related .= ' from ' . $relation->getRelated()->getTable(); |
|
| 72 | + $related .= ' from '.$relation->getRelated()->getTable(); |
|
| 73 | 73 | } |
| 74 | 74 | } else { |
| 75 | 75 | $through[] = $this->hasOneOrManyThroughParent($relation, $relations[$i + 1]); |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | $through = get_class($relation->getRelated()); |
| 279 | 279 | |
| 280 | 280 | if ((new $through())->getTable() !== $relation->getRelated()->getTable()) { |
| 281 | - $through .= ' from ' . $relation->getRelated()->getTable(); |
|
| 281 | + $through .= ' from '.$relation->getRelated()->getTable(); |
|
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | if (get_class($relation->getRelated()) === get_class($successor->getParent())) { |
@@ -330,11 +330,11 @@ discard block |
||
| 330 | 330 | protected function addConstraintsToHasOneOrManyDeepRelationship( |
| 331 | 331 | HasManyDeep $deepRelation, |
| 332 | 332 | array $relations |
| 333 | - ): HasManyDeep|HasOneDeep { |
|
| 333 | + ): HasManyDeep | HasOneDeep { |
|
| 334 | 334 | $relations = $this->normalizeVariadicRelations($relations); |
| 335 | 335 | |
| 336 | 336 | foreach ($relations as $i => $relation) { |
| 337 | - $relationWithoutConstraints = Relation::noConstraints(function () use ($relation) { |
|
| 337 | + $relationWithoutConstraints = Relation::noConstraints(function() use ($relation) { |
|
| 338 | 338 | return $relation(); |
| 339 | 339 | }); |
| 340 | 340 | |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | $deepRelation->withTrashed($deletedAtColumn); |
| 384 | 384 | } |
| 385 | 385 | |
| 386 | - if (str_starts_with($scope, HasManyDeep::class . ':')) { |
|
| 386 | + if (str_starts_with($scope, HasManyDeep::class.':')) { |
|
| 387 | 387 | $deletedAtColumn = explode(':', $scope)[1]; |
| 388 | 388 | |
| 389 | 389 | $deepRelation->withTrashed($deletedAtColumn); |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | protected function addEagerConstraintsWithCompositeKey(array $models): void |
| 47 | 47 | { |
| 48 | 48 | $keys = collect($models)->map( |
| 49 | - function (Model $model) { |
|
| 49 | + function(Model $model) { |
|
| 50 | 50 | return array_map( |
| 51 | 51 | fn (string $column) => $model[$column], |
| 52 | 52 | $this->localKeys[0]->columns |
@@ -55,10 +55,10 @@ discard block |
||
| 55 | 55 | )->values()->unique(null, true)->all(); |
| 56 | 56 | |
| 57 | 57 | $this->query->where( |
| 58 | - function (Builder $query) use ($models, $keys) { |
|
| 58 | + function(Builder $query) use ($models, $keys) { |
|
| 59 | 59 | foreach ($keys as $key) { |
| 60 | 60 | $query->orWhere( |
| 61 | - function (Builder $query) use ($key) { |
|
| 61 | + function(Builder $query) use ($key) { |
|
| 62 | 62 | foreach ($this->foreignKeys[0]->columns as $i => $column) { |
| 63 | 63 | $query->where( |
| 64 | 64 | $this->throughParent->qualifyColumn($column), |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $values = []; |
| 122 | 122 | |
| 123 | 123 | foreach ($this->foreignKeys[0]->columns as $i => $column) { |
| 124 | - $alias = 'laravel_through_key' . ($i > 0 ? "_$i" : ''); |
|
| 124 | + $alias = 'laravel_through_key'.($i > 0 ? "_$i" : ''); |
|
| 125 | 125 | |
| 126 | 126 | $values[] = $result->$alias; |
| 127 | 127 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $columns = array_slice($this->foreignKeys[0]->columns, 1, null, true); |
| 145 | 145 | |
| 146 | 146 | return array_map( |
| 147 | - fn ($column, $i) => $this->throughParent->qualifyColumn($column) . " as laravel_through_key_$i", |
|
| 147 | + fn ($column, $i) => $this->throughParent->qualifyColumn($column)." as laravel_through_key_$i", |
|
| 148 | 148 | $columns, |
| 149 | 149 | array_keys($columns) |
| 150 | 150 | ); |