Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Improve "exists" validation with array values
Browse files Browse the repository at this point in the history
* Fix return values in validation tests

* Fix exists validation with duplicate values

* Fix exists validation with duplicate database values

laravel/framework#25819

laravel/framework@144c613
  • Loading branch information
Omranic committed Aug 20, 2022
1 parent bf5b326 commit 3137ce0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Verifiers/EloquentPresenceVerifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function getMultiCount($collection, $column, array $values, array $extra
{
$query = $this->model($collection)->whereIn($column, $values);

return $this->addConditions($query, $extra)->count();
return $this->addConditions($query, $extra)->distinct()->count($column);
}

/**
Expand Down

0 comments on commit 3137ce0

Please sign in to comment.