From 074c8d8a2e1c0479c48ec488b240ff1000746af8 Mon Sep 17 00:00:00 2001 From: Tyler Date: Mon, 25 Sep 2023 14:53:49 -0500 Subject: [PATCH] ~ Patch array fix --- src/Mixins/JoinsRelationships.php | 60 +++++++++++++++---------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/Mixins/JoinsRelationships.php b/src/Mixins/JoinsRelationships.php index abd9120..799d934 100644 --- a/src/Mixins/JoinsRelationships.php +++ b/src/Mixins/JoinsRelationships.php @@ -425,12 +425,12 @@ public function leftJoinRelation() * Add a relationship left join condition to the query. * * @param string $relation - * @param \Closure|null $callback + * @param \Closure|array|null $callback * @param bool $through * * @return \Illuminate\Database\Eloquent\Builder|static */ - return function ($relation, Closure $callback = null, $through = false) { + return function ($relation, Closure|array $callback = null, $through = false) { return $this->joinRelation($relation, $callback, 'left', $through); }; } @@ -446,12 +446,12 @@ public function rightJoinRelation() * Add a relationship right join condition to the query. * * @param string $relation - * @param \Closure|null $callback + * @param \Closure|array|null $callback * @param bool $through * * @return \Illuminate\Database\Eloquent\Builder|static */ - return function ($relation, Closure $callback = null, $through = false) { + return function ($relation, Closure|array $callback = null, $through = false) { return $this->joinRelation($relation, $callback, 'right', $through); }; } @@ -467,12 +467,12 @@ public function crossJoinRelation() * Add a relationship cross join condition to the query. * * @param string $relation - * @param \Closure|null $callback + * @param \Closure|array|null $callback * @param bool $through * * @return \Illuminate\Database\Eloquent\Builder|static */ - return function ($relation, Closure $callback = null, $through = false) { + return function ($relation, Closure|array $callback = null, $through = false) { return $this->joinRelation($relation, $callback, 'cross', $through); }; } @@ -488,12 +488,12 @@ public function joinThroughRelation() * Add a relationship join condition through a related model to the query. * * @param string $relation - * @param \Closure|null $callback + * @param \Closure|array|null $callback * @param string $type * * @return \Illuminate\Database\Eloquent\Builder|static */ - return function ($relation, Closure $callback = null, $type = 'inner') { + return function ($relation, Closure|array $callback = null, $type = 'inner') { return $this->joinRelation($relation, $callback, $type, true); }; } @@ -509,11 +509,11 @@ public function leftJoinThroughRelation() * Add a relationship left join condition through a related model to the query. * * @param string $relation - * @param \Closure|null $callback + * @param \Closure|array|null $callback * * @return \Illuminate\Database\Eloquent\Builder|static */ - return function ($relation, Closure $callback = null) { + return function ($relation, Closure|array $callback = null) { return $this->joinRelation($relation, $callback, 'left', true); }; } @@ -529,11 +529,11 @@ public function rightJoinThroughRelation() * Add a relationship right join condition through a related model to the query. * * @param string $relation - * @param \Closure|null $callback + * @param \Closure|array|null $callback * * @return \Illuminate\Database\Eloquent\Builder|static */ - return function ($relation, Closure $callback = null) { + return function ($relation, Closure|array $callback = null) { return $this->joinRelation($relation, $callback, 'right', true); }; } @@ -549,11 +549,11 @@ public function crossJoinThroughRelation() * Add a relationship cross join condition through a related model to the query. * * @param string $relation - * @param \Closure|null $callback + * @param \Closure|array|null $callback * * @return \Illuminate\Database\Eloquent\Builder|static */ - return function ($relation, Closure $callback = null) { + return function ($relation, Closure|array $callback = null) { return $this->joinRelation($relation, $callback, 'cross', true); }; } @@ -570,14 +570,14 @@ public function joinMorphRelation() * * @param string|array $relation * @param string|array $morphTypes - * @param \Closure|null $callback + * @param \Closure|array|null $callback * @param string $type * @param bool $through * @param \Illuminate\Database\Eloquent\Builder $relatedQuery * * @return \Illuminate\Database\Eloquent\Builder|static */ - return function ($relation, $morphTypes = ['*'], Closure $callback = null, $type = 'inner', $through = false, Builder $relatedQuery = null) { + return function ($relation, $morphTypes = ['*'], Closure|array $callback = null, $type = 'inner', $through = false, Builder $relatedQuery = null) { return $this->joinRelation($relation, $callback, $type, $through, $relatedQuery, $morphTypes); }; } @@ -594,12 +594,12 @@ public function leftJoinMorphRelation() * * @param string $relation * @param string|array $morphTypes - * @param \Closure|null $callback + * @param \Closure|array|null $callback * @param bool $through * * @return \Illuminate\Database\Eloquent\Builder|static */ - return function ($relation, $morphTypes = ['*'], Closure $callback = null, $through = false) { + return function ($relation, $morphTypes = ['*'], Closure|array $callback = null, $through = false) { return $this->joinRelation($relation, $callback, 'left', $through, null, $morphTypes); }; } @@ -616,12 +616,12 @@ public function rightJoinMorphRelation() * * @param string $relation * @param string|array $morphTypes - * @param \Closure|null $callback + * @param \Closure|array|null $callback * @param bool $through * * @return \Illuminate\Database\Eloquent\Builder|static */ - return function ($relation, $morphTypes = ['*'], Closure $callback = null, $through = false) { + return function ($relation, $morphTypes = ['*'], Closure|array $callback = null, $through = false) { return $this->joinRelation($relation, $callback, 'right', $through, null, $morphTypes); }; } @@ -638,12 +638,12 @@ public function crossJoinMorphRelation() * * @param string $relation * @param string|array $morphTypes - * @param \Closure|null $callback + * @param \Closure|array|null $callback * @param bool $through * * @return \Illuminate\Database\Eloquent\Builder|static */ - return function ($relation, $morphTypes = ['*'], Closure $callback = null, $through = false) { + return function ($relation, $morphTypes = ['*'], Closure|array $callback = null, $through = false) { return $this->joinRelation($relation, $callback, 'cross', $through, null, $morphTypes); }; } @@ -660,12 +660,12 @@ public function joinThroughMorphRelation() * * @param string $relation * @param string|array $morphTypes - * @param \Closure|null $callback + * @param \Closure|array|null $callback * @param string $type * * @return \Illuminate\Database\Eloquent\Builder|static */ - return function ($relation, $morphTypes = ['*'], Closure $callback = null, $type = 'inner') { + return function ($relation, $morphTypes = ['*'], Closure|array $callback = null, $type = 'inner') { return $this->joinRelation($relation, $callback, $type, true, null, $morphTypes); }; } @@ -682,11 +682,11 @@ public function leftJoinThroughMorphRelation() * * @param string $relation * @param string|array $morphTypes - * @param \Closure|null $callback + * @param \Closure|array|null $callback * * @return \Illuminate\Database\Eloquent\Builder|static */ - return function ($relation, $morphTypes = ['*'], Closure $callback = null) { + return function ($relation, $morphTypes = ['*'], Closure|array $callback = null) { return $this->joinRelation($relation, $callback, 'left', true, null, $morphTypes); }; } @@ -703,11 +703,11 @@ public function rightJoinThroughMorphRelation() * * @param string $relation * @param string|array $morphTypes - * @param \Closure|null $callback + * @param \Closure|array|null $callback * * @return \Illuminate\Database\Eloquent\Builder|static */ - return function ($relation, $morphTypes = ['*'], Closure $callback = null) { + return function ($relation, $morphTypes = ['*'], Closure|array $callback = null) { return $this->joinRelation($relation, $callback, 'right', true, null, $morphTypes); }; } @@ -724,11 +724,11 @@ public function crossJoinThroughMorphRelation() * * @param string $relation * @param string|array $morphTypes - * @param \Closure|null $callback + * @param \Closure|array|null $callback * * @return \Illuminate\Database\Eloquent\Builder|static */ - return function ($relation, $morphTypes = ['*'], Closure $callback = null) { + return function ($relation, $morphTypes = ['*'], Closure|array $callback = null) { return $this->joinRelation($relation, $callback, 'cross', true, null, $morphTypes); }; }