From cc256136530761a88a6c2bfe66bd68f21716d2db Mon Sep 17 00:00:00 2001 From: Sander Muller Date: Fri, 26 Apr 2024 14:57:39 +0200 Subject: [PATCH 1/2] Fix return types of firstWhere and first of BelongsToMany --- src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php b/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php index 7a90dc998cc0..ef17cce6371c 100755 --- a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php +++ b/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php @@ -784,7 +784,7 @@ public function findOr($id, $columns = ['*'], ?Closure $callback = null) * @param mixed $operator * @param mixed $value * @param string $boolean - * @return \Illuminate\Database\Eloquent\Model|static + * @return \Illuminate\Database\Eloquent\Model|static|null */ public function firstWhere($column, $operator = null, $value = null, $boolean = 'and') { @@ -795,7 +795,7 @@ public function firstWhere($column, $operator = null, $value = null, $boolean = * Execute the query and get the first result. * * @param array $columns - * @return mixed + * @return \Illuminate\Database\Eloquent\Model|static|null */ public function first($columns = ['*']) { From da82edfdd2c30ef4b10c1f046482239f766c65b6 Mon Sep 17 00:00:00 2001 From: Sander Muller Date: Fri, 26 Apr 2024 15:00:43 +0200 Subject: [PATCH 2/2] Fix return types of HasManyThrough --- src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php b/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php index 70dd922b20b0..2f3dc31fef60 100644 --- a/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php +++ b/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php @@ -320,7 +320,7 @@ public function updateOrCreate(array $attributes, array $values = []) * @param mixed $operator * @param mixed $value * @param string $boolean - * @return \Illuminate\Database\Eloquent\Model|static + * @return \Illuminate\Database\Eloquent\Model|static|null */ public function firstWhere($column, $operator = null, $value = null, $boolean = 'and') { @@ -331,7 +331,7 @@ public function firstWhere($column, $operator = null, $value = null, $boolean = * Execute the query and get the first related model. * * @param array $columns - * @return mixed + * @return \Illuminate\Database\Eloquent\Model|static|null */ public function first($columns = ['*']) {