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

Commit

Permalink
Optimize regex in DatabasePresenceVerifier
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Aug 21, 2023
1 parent 9f1f8f3 commit 2fce940
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Validation/DatabasePresenceVerifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function getCount($collection, $column, $value, $excludeId = null, $idCol
public function getMultiCount($collection, $column, array $values, array $extra = [])
{
// Generates a regex like '/(a|b|c)/i' which can query multiple values
$regex = '/('.implode('|', $values).')/i';
$regex = new Regex('('.implode('|', $values).')', 'i');

$query = $this->table($collection)->where($column, 'regex', $regex);

Expand Down

0 comments on commit 2fce940

Please sign in to comment.