From 5a6f2f888d1165f05b38fad4cd43f83a302ece6e Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 31 Jan 2012 14:21:59 -0600 Subject: [PATCH] unfix bug in validator, heh. --- laravel/validator.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/laravel/validator.php b/laravel/validator.php index 08668d75..7937ec38 100644 --- a/laravel/validator.php +++ b/laravel/validator.php @@ -427,7 +427,9 @@ protected function validate_unique($attribute, $value, $parameters) // fine for the given ID to exist in the table. if (isset($parameters[2])) { - $query->where($attribute, '<>', $parameters[2]); + $id = (isset($parameters[3])) ? $parameters[3] : 'id'; + + $query->where($id, '<>', $parameters[2]); } return $query->count() == 0;