From 89768c1961f5433e7e8f0526526a3edd5386f915 Mon Sep 17 00:00:00 2001 From: t d h smith Date: Wed, 1 Jun 2016 17:17:13 -0500 Subject: [PATCH] Match unique rules with no parameters As it stands, the example provided in the README (`'email' => 'required|email|unique',`) doesn't work because `buildUniqueExclusionRules` is searching specifically for `unique:`, ending with a colon. Presumably this isn't intentional, based on the later `count(explode(':', $params[0]))` check which currently would be impossible to trigger, so the string match has been adjusted. --- src/Ardent/Ardent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ardent/Ardent.php b/src/Ardent/Ardent.php index ba64236..cb21d23 100755 --- a/src/Ardent/Ardent.php +++ b/src/Ardent/Ardent.php @@ -838,7 +838,7 @@ public function buildUniqueExclusionRules(array $rules = array()) { $ruleset = (is_string($ruleset))? explode('|', $ruleset) : $ruleset; foreach ($ruleset as &$rule) { - if (strpos($rule, 'unique:') === 0) { + if (strpos($rule, 'unique') === 0) { // Stop splitting at 4 so final param will hold optional where clause $params = explode(',', $rule, 4);