@@ -71,18 +71,18 @@ |
||
| 71 | 71 | */ |
| 72 | 72 | public function compileMemberOf(string $column, ?string $objectKey, mixed $value): string |
| 73 | 73 | { |
| 74 | - $columnWithKey = $objectKey ? $column . (str_contains($column, '->') ? '[*]' : '') . "->$objectKey" : $column; |
|
| 74 | + $columnWithKey = $objectKey ? $column.(str_contains($column, '->') ? '[*]' : '')."->$objectKey" : $column; |
|
| 75 | 75 | |
| 76 | 76 | [$field, $path] = $this->wrapJsonFieldAndPath($columnWithKey); |
| 77 | 77 | |
| 78 | 78 | if ($objectKey && !str_contains($column, '->')) { |
| 79 | - $path = ", '$[*]" . substr($path, 4); |
|
| 79 | + $path = ", '$[*]".substr($path, 4); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | $sql = $path ? "json_extract($field$path)" : $field; |
| 83 | 83 | |
| 84 | 84 | if ($value instanceof Expression) { |
| 85 | - return $value->getValue($this) . " member of($sql)"; |
|
| 85 | + return $value->getValue($this)." member of($sql)"; |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | return "? member of($sql)"; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | { |
| 80 | 80 | $parentKeys = $this->getKeys($models, $this->localKey); |
| 81 | 81 | |
| 82 | - $this->query->where(function (Builder $query) use ($parentKeys) { |
|
| 82 | + $this->query->where(function(Builder $query) use ($parentKeys) { |
|
| 83 | 83 | foreach ($parentKeys as $parentKey) { |
| 84 | 84 | $this->whereJsonContainsOrMemberOf( |
| 85 | 85 | $query, |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | */ |
| 210 | 210 | public function getRelationExistenceQueryForSelfRelation(Builder $query, Builder $parentQuery, $columns = ['*']) |
| 211 | 211 | { |
| 212 | - $query->from($query->getModel()->getTable() . ' as ' . $hash = $this->getRelationCountHash()); |
|
| 212 | + $query->from($query->getModel()->getTable().' as '.$hash = $this->getRelationCountHash()); |
|
| 213 | 213 | |
| 214 | 214 | $query->getModel()->setTable($hash); |
| 215 | 215 | |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | |
| 220 | 220 | $this->whereJsonContainsOrMemberOf( |
| 221 | 221 | $query, |
| 222 | - $hash . '.' . $this->getPathName(), |
|
| 222 | + $hash.'.'.$this->getPathName(), |
|
| 223 | 223 | $query->getQuery()->connection->raw($sql) |
| 224 | 224 | ); |
| 225 | 225 | |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | $key = str_replace('->', '.', $this->key); |
| 274 | 274 | |
| 275 | 275 | $record = (new BaseCollection($records)) |
| 276 | - ->filter(function ($value) use ($key, $parent) { |
|
| 276 | + ->filter(function($value) use ($key, $parent) { |
|
| 277 | 277 | return Arr::get($value, $key) == $parent->{$this->localKey}; |
| 278 | 278 | })->first(); |
| 279 | 279 | |