Skip to content

Commit

Permalink
Fix return types of firstWhere and first of BelongsToMany and `…
Browse files Browse the repository at this point in the history
…HasManyThrough` (#51219)

* Fix return types of firstWhere and first of BelongsToMany

* Fix return types of HasManyThrough
  • Loading branch information
SanderMuller authored Apr 26, 2024
1 parent 9fd1c07 commit f993b9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
{
Expand All @@ -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 = ['*'])
{
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
{
Expand All @@ -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 = ['*'])
{
Expand Down

0 comments on commit f993b9c

Please sign in to comment.