@@ -135,9 +135,9 @@ discard block |
||
135 | 135 | $query->join($throughParent->getTable(), $first, '=', $second); |
136 | 136 | |
137 | 137 | if ($this->throughParentInstanceSoftDeletes($throughParent)) { |
138 | - $column= $throughParent->getQualifiedDeletedAtColumn(); |
|
138 | + $column = $throughParent->getQualifiedDeletedAtColumn(); |
|
139 | 139 | |
140 | - $query->withGlobalScope(__CLASS__ . ":$column", function (Builder $query) use ($column) { |
|
140 | + $query->withGlobalScope(__CLASS__.":$column", function(Builder $query) use ($column) { |
|
141 | 141 | $query->whereNull($column); |
142 | 142 | }); |
143 | 143 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | |
204 | 204 | $this->query->addSelect($columns); |
205 | 205 | |
206 | - return tap($this->query->paginate($perPage, $columns, $pageName, $page), function (Paginator $paginator) { |
|
206 | + return tap($this->query->paginate($perPage, $columns, $pageName, $page), function(Paginator $paginator) { |
|
207 | 207 | $this->hydrateIntermediateRelations($paginator->items()); |
208 | 208 | }); |
209 | 209 | } |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | |
226 | 226 | $this->query->addSelect($columns); |
227 | 227 | |
228 | - return tap($this->query->simplePaginate($perPage, $columns, $pageName, $page), function (Paginator $paginator) { |
|
228 | + return tap($this->query->simplePaginate($perPage, $columns, $pageName, $page), function(Paginator $paginator) { |
|
229 | 229 | $this->hydrateIntermediateRelations($paginator->items()); |
230 | 230 | }); |
231 | 231 | } |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | |
248 | 248 | $this->query->addSelect($columns); |
249 | 249 | |
250 | - return tap($this->query->cursorPaginate($perPage, $columns, $cursorName, $cursor), function (CursorPaginator $paginator) { |
|
250 | + return tap($this->query->cursorPaginate($perPage, $columns, $cursorName, $cursor), function(CursorPaginator $paginator) { |
|
251 | 251 | $this->hydrateIntermediateRelations($paginator->items()); |
252 | 252 | }); |
253 | 253 | } |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | */ |
273 | 273 | public function chunk($count, callable $callback) |
274 | 274 | { |
275 | - return $this->prepareQueryBuilder()->chunk($count, function (Collection $results) use ($callback) { |
|
275 | + return $this->prepareQueryBuilder()->chunk($count, function(Collection $results) use ($callback) { |
|
276 | 276 | $this->hydrateIntermediateRelations($results->all()); |
277 | 277 | |
278 | 278 | return $callback($results); |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | ); |
304 | 304 | } |
305 | 305 | |
306 | - $table = $throughParent->getTable() . ' as ' . $this->getRelationCountHash(); |
|
306 | + $table = $throughParent->getTable().' as '.$this->getRelationCountHash(); |
|
307 | 307 | |
308 | 308 | $throughParent->setTable($table); |
309 | 309 | |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | } |
367 | 367 | |
368 | 368 | foreach ($columns as $column) { |
369 | - $this->query->withoutGlobalScope(__CLASS__ . ":$column"); |
|
369 | + $this->query->withoutGlobalScope(__CLASS__.":$column"); |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | return $this; |
@@ -100,7 +100,7 @@ |
||
100 | 100 | */ |
101 | 101 | protected function hasOneOrManyDeepThroughParents(array $through) |
102 | 102 | { |
103 | - return array_map(function ($class) { |
|
103 | + return array_map(function($class) { |
|
104 | 104 | $segments = preg_split('/\s+(as|from)\s+/i', $class, -1, PREG_SPLIT_DELIM_CAPTURE); |
105 | 105 | |
106 | 106 | $instance = str_contains($segments[0], '\\') |
@@ -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 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $related = get_class($relation->getRelated()); |
72 | 72 | |
73 | 73 | if ((new $related())->getTable() !== $relation->getRelated()->getTable()) { |
74 | - $related .= ' from ' . $relation->getRelated()->getTable(); |
|
74 | + $related .= ' from '.$relation->getRelated()->getTable(); |
|
75 | 75 | } |
76 | 76 | } else { |
77 | 77 | $through[] = $this->hasOneOrManyThroughParent($relation, $relations[$i + 1]); |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | $through = get_class($relation->getRelated()); |
281 | 281 | |
282 | 282 | if ((new $through())->getTable() !== $relation->getRelated()->getTable()) { |
283 | - $through .= ' from ' . $relation->getRelated()->getTable(); |
|
283 | + $through .= ' from '.$relation->getRelated()->getTable(); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | if (get_class($relation->getRelated()) === get_class($successor->getParent())) { |
@@ -332,13 +332,13 @@ discard block |
||
332 | 332 | protected function addConstraintsToHasOneOrManyDeepRelationship( |
333 | 333 | HasManyDeep $deepRelation, |
334 | 334 | array $relations |
335 | - ): HasManyDeep|HasOneDeep { |
|
335 | + ): HasManyDeep | HasOneDeep { |
|
336 | 336 | if (is_array($relations[0]) && !is_callable($relations[0])) { |
337 | 337 | $relations = $relations[0]; |
338 | 338 | } |
339 | 339 | |
340 | 340 | foreach ($relations as $i => $relation) { |
341 | - $relationWithoutConstraints = Relation::noConstraints(function () use ($relation) { |
|
341 | + $relationWithoutConstraints = Relation::noConstraints(function() use ($relation) { |
|
342 | 342 | return $relation(); |
343 | 343 | }); |
344 | 344 | |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | $deepRelation->withTrashed($deletedAtColumn); |
388 | 388 | } |
389 | 389 | |
390 | - if (str_starts_with($scope, HasManyDeep::class . ':')) { |
|
390 | + if (str_starts_with($scope, HasManyDeep::class.':')) { |
|
391 | 391 | $deletedAtColumn = explode(':', $scope)[1]; |
392 | 392 | |
393 | 393 | $deepRelation->withTrashed($deletedAtColumn); |