@@ -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 | } |
@@ -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]); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | $this->query->addSelect($columns); |
62 | 62 | |
63 | - return tap($this->query->paginate($perPage, $columns, $pageName, $page), function (Paginator $paginator) { |
|
63 | + return tap($this->query->paginate($perPage, $columns, $pageName, $page), function(Paginator $paginator) { |
|
64 | 64 | $this->hydrateIntermediateRelations($paginator->items()); |
65 | 65 | }); |
66 | 66 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | $this->query->addSelect($columns); |
85 | 85 | |
86 | - return tap($this->query->simplePaginate($perPage, $columns, $pageName, $page), function (Paginator $paginator) { |
|
86 | + return tap($this->query->simplePaginate($perPage, $columns, $pageName, $page), function(Paginator $paginator) { |
|
87 | 87 | $this->hydrateIntermediateRelations($paginator->items()); |
88 | 88 | }); |
89 | 89 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | $this->query->addSelect($columns); |
108 | 108 | |
109 | - return tap($this->query->cursorPaginate($perPage, $columns, $cursorName, $cursor), function (CursorPaginator $paginator) { |
|
109 | + return tap($this->query->cursorPaginate($perPage, $columns, $cursorName, $cursor), function(CursorPaginator $paginator) { |
|
110 | 110 | $this->hydrateIntermediateRelations($paginator->items()); |
111 | 111 | }); |
112 | 112 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | */ |
121 | 121 | public function chunk($count, callable $callback) |
122 | 122 | { |
123 | - return $this->prepareQueryBuilder()->chunk($count, function (Collection $results) use ($callback) { |
|
123 | + return $this->prepareQueryBuilder()->chunk($count, function(Collection $results) use ($callback) { |
|
124 | 124 | $this->hydrateIntermediateRelations($results->all()); |
125 | 125 | |
126 | 126 | return $callback($results); |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | if (is_array($relation->getOwnerKeyName())) { |
33 | 33 | // https://github.com/topclaudy/compoships |
34 | 34 | $foreignKeys[] = new CompositeKey( |
35 | - ...(array)$relation->getOwnerKeyName() |
|
35 | + ...(array) $relation->getOwnerKeyName() |
|
36 | 36 | ); |
37 | 37 | |
38 | 38 | $localKeys[] = new CompositeKey( |
39 | - ...(array)$relation->getForeignKeyName() |
|
39 | + ...(array) $relation->getForeignKeyName() |
|
40 | 40 | ); |
41 | 41 | } else { |
42 | 42 | $foreignKeys[] = $relation->getOwnerKeyName(); |
@@ -91,11 +91,11 @@ discard block |
||
91 | 91 | if (is_array($relation->getForeignKeyName())) { |
92 | 92 | // https://github.com/topclaudy/compoships |
93 | 93 | $foreignKeys[] = new CompositeKey( |
94 | - ...(array)$relation->getForeignKeyName() |
|
94 | + ...(array) $relation->getForeignKeyName() |
|
95 | 95 | ); |
96 | 96 | |
97 | 97 | $localKeys[] = new CompositeKey( |
98 | - ...(array)$relation->getLocalKeyName() |
|
98 | + ...(array) $relation->getLocalKeyName() |
|
99 | 99 | ); |
100 | 100 | } else { |
101 | 101 | $foreignKeys[] = $relation->getForeignKeyName(); |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | |
208 | 208 | foreach ($classes as $class) { |
209 | 209 | if ($relation instanceof $class) { |
210 | - return 'hasOneOrManyDeepFrom' . class_basename($class); |
|
210 | + return 'hasOneOrManyDeepFrom'.class_basename($class); |
|
211 | 211 | } |
212 | 212 | } |
213 | 213 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | ); |
34 | 34 | } |
35 | 35 | |
36 | - $table = $throughParent->getTable() . ' as ' . $this->getRelationCountHash(); |
|
36 | + $table = $throughParent->getTable().' as '.$this->getRelationCountHash(); |
|
37 | 37 | |
38 | 38 | $throughParent->setTable($table); |
39 | 39 |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $columns[] = $throughKey; |
160 | 160 | } |
161 | 161 | } else { |
162 | - $columns[] = $this->getQualifiedFirstKeyName() . " as $alias"; |
|
162 | + $columns[] = $this->getQualifiedFirstKeyName()." as $alias"; |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | if ($this->hasLeadingCompositeKey()) { |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | } |
192 | 192 | |
193 | 193 | foreach ($columns as $column) { |
194 | - $this->query->withoutGlobalScope(__CLASS__ . ":$column"); |
|
194 | + $this->query->withoutGlobalScope(__CLASS__.":$column"); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | return $this; |
@@ -45,14 +45,14 @@ |
||
45 | 45 | protected function publishConfig(): void |
46 | 46 | { |
47 | 47 | $this->publishes([ |
48 | - __DIR__ . '/../config/eloquent-has-many-deep.php' => config_path('eloquent-has-many-deep.php'), |
|
48 | + __DIR__.'/../config/eloquent-has-many-deep.php' => config_path('eloquent-has-many-deep.php'), |
|
49 | 49 | ], 'eloquent-has-many-deep'); |
50 | 50 | } |
51 | 51 | |
52 | 52 | protected function registerConfig(): void |
53 | 53 | { |
54 | 54 | $this->mergeConfigFrom( |
55 | - __DIR__ . '/../config/eloquent-has-many-deep.php', |
|
55 | + __DIR__.'/../config/eloquent-has-many-deep.php', |
|
56 | 56 | 'eloquent-has-many-deep', |
57 | 57 | ); |
58 | 58 | } |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | $manyRelation = !$relationship instanceof HasOneDeep; |
51 | 51 | |
52 | 52 | $type = $manyRelation |
53 | - ? '\\' . Collection::class . '|\\' . $relationship->getRelated()::class . '[]' |
|
54 | - : '\\' . $relationship->getRelated()::class; |
|
53 | + ? '\\'.Collection::class.'|\\'.$relationship->getRelated()::class.'[]' |
|
54 | + : '\\'.$relationship->getRelated()::class; |
|
55 | 55 | |
56 | 56 | $command->setProperty( |
57 | 57 | $method->getName(), |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | if ($manyRelation) { |
66 | 66 | $command->setProperty( |
67 | - Str::snake($method->getName()) . '_count', |
|
67 | + Str::snake($method->getName()).'_count', |
|
68 | 68 | 'int', |
69 | 69 | true, |
70 | 70 | false, |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | protected function addEagerConstraintsWithCompositeKey(array $models): void |
48 | 48 | { |
49 | 49 | $keys = (new BaseCollection($models))->map( |
50 | - function (Model $model) { |
|
50 | + function(Model $model) { |
|
51 | 51 | return array_map( |
52 | 52 | fn (string $column) => $model[$column], |
53 | 53 | $this->localKeys[0]->columns |
@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | )->values()->unique(null, true)->all(); |
57 | 57 | |
58 | 58 | $this->query->where( |
59 | - function (Builder $query) use ($keys) { |
|
59 | + function(Builder $query) use ($keys) { |
|
60 | 60 | foreach ($keys as $key) { |
61 | 61 | $query->orWhere( |
62 | - function (Builder $query) use ($key) { |
|
62 | + function(Builder $query) use ($key) { |
|
63 | 63 | foreach ($this->foreignKeys[0]->columns as $i => $column) { |
64 | 64 | $query->where( |
65 | 65 | $this->throughParent->qualifyColumn($column), |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $values = []; |
123 | 123 | |
124 | 124 | foreach ($this->foreignKeys[0]->columns as $i => $column) { |
125 | - $alias = 'laravel_through_key' . ($i > 0 ? "_$i" : ''); |
|
125 | + $alias = 'laravel_through_key'.($i > 0 ? "_$i" : ''); |
|
126 | 126 | |
127 | 127 | $values[] = $result->$alias; |
128 | 128 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $columns = array_slice($this->foreignKeys[0]->columns, 1, null, true); |
146 | 146 | |
147 | 147 | return array_map( |
148 | - fn ($column, $i) => $this->throughParent->qualifyColumn($column) . " as laravel_through_key_$i", |
|
148 | + fn ($column, $i) => $this->throughParent->qualifyColumn($column)." as laravel_through_key_$i", |
|
149 | 149 | $columns, |
150 | 150 | array_keys($columns) |
151 | 151 | ); |