@@ -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); |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | |
| 78 | 78 | if ($throughParent instanceof Pivot) { |
| 79 | 79 | if (isset($segments[1])) { |
| 80 | - $class = $throughParent::class . " as $segments[1]"; |
|
| 80 | + $class = $throughParent::class." as $segments[1]"; |
|
| 81 | 81 | } else { |
| 82 | 82 | $class = $table; |
| 83 | 83 | } |
@@ -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 | ); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | $query->join( |
| 36 | 36 | $throughParent->getTable(), |
| 37 | - function (JoinClause $join) use ($joins) { |
|
| 37 | + function(JoinClause $join) use ($joins) { |
|
| 38 | 38 | foreach ($joins as [$first, $second]) { |
| 39 | 39 | $join->on($first, '=', $second); |
| 40 | 40 | } |
@@ -42,9 +42,9 @@ discard block |
||
| 42 | 42 | ); |
| 43 | 43 | |
| 44 | 44 | if ($this->throughParentInstanceSoftDeletes($throughParent)) { |
| 45 | - $column= $throughParent->getQualifiedDeletedAtColumn(); |
|
| 45 | + $column = $throughParent->getQualifiedDeletedAtColumn(); |
|
| 46 | 46 | |
| 47 | - $query->withGlobalScope(__CLASS__ . ":$column", function (Builder $query) use ($column) { |
|
| 47 | + $query->withGlobalScope(__CLASS__.":$column", function(Builder $query) use ($column) { |
|
| 48 | 48 | $query->whereNull($column); |
| 49 | 49 | }); |
| 50 | 50 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | $this->query->addSelect($columns); |
| 195 | 195 | |
| 196 | - return tap($this->query->paginate($perPage, $columns, $pageName, $page), function (Paginator $paginator) { |
|
| 196 | + return tap($this->query->paginate($perPage, $columns, $pageName, $page), function(Paginator $paginator) { |
|
| 197 | 197 | $this->hydrateIntermediateRelations($paginator->items()); |
| 198 | 198 | }); |
| 199 | 199 | } |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | |
| 217 | 217 | $this->query->addSelect($columns); |
| 218 | 218 | |
| 219 | - return tap($this->query->simplePaginate($perPage, $columns, $pageName, $page), function (Paginator $paginator) { |
|
| 219 | + return tap($this->query->simplePaginate($perPage, $columns, $pageName, $page), function(Paginator $paginator) { |
|
| 220 | 220 | $this->hydrateIntermediateRelations($paginator->items()); |
| 221 | 221 | }); |
| 222 | 222 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | |
| 240 | 240 | $this->query->addSelect($columns); |
| 241 | 241 | |
| 242 | - return tap($this->query->cursorPaginate($perPage, $columns, $cursorName, $cursor), function (CursorPaginator $paginator) { |
|
| 242 | + return tap($this->query->cursorPaginate($perPage, $columns, $cursorName, $cursor), function(CursorPaginator $paginator) { |
|
| 243 | 243 | $this->hydrateIntermediateRelations($paginator->items()); |
| 244 | 244 | }); |
| 245 | 245 | } |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | */ |
| 274 | 274 | public function chunk($count, callable $callback) |
| 275 | 275 | { |
| 276 | - return $this->prepareQueryBuilder()->chunk($count, function (Collection $results) use ($callback) { |
|
| 276 | + return $this->prepareQueryBuilder()->chunk($count, function(Collection $results) use ($callback) { |
|
| 277 | 277 | $this->hydrateIntermediateRelations($results->all()); |
| 278 | 278 | |
| 279 | 279 | return $callback($results); |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | ); |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | - $table = $throughParent->getTable() . ' as ' . $this->getRelationCountHash(); |
|
| 307 | + $table = $throughParent->getTable().' as '.$this->getRelationCountHash(); |
|
| 308 | 308 | |
| 309 | 309 | $throughParent->setTable($table); |
| 310 | 310 | |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | foreach ($columns as $column) { |
| 372 | - $this->query->withoutGlobalScope(__CLASS__ . ":$column"); |
|
| 372 | + $this->query->withoutGlobalScope(__CLASS__.":$column"); |
|
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | return $this; |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | */ |
| 79 | 79 | protected function hasOneOrManyDeepThroughParents(array $through) |
| 80 | 80 | { |
| 81 | - return array_map(function ($class) { |
|
| 81 | + return array_map(function($class) { |
|
| 82 | 82 | $segments = preg_split('/\s+(as|from)\s+/i', $class, -1, PREG_SPLIT_DELIM_CAPTURE); |
| 83 | 83 | |
| 84 | 84 | $instance = $this->newRelatedDeepThroughInstance($segments[0]); |