From 028044d87d5f029868de41a5042554f6dc612afa Mon Sep 17 00:00:00 2001 From: Igor Santos Date: Mon, 7 Dec 2015 15:05:14 -0200 Subject: [PATCH] Enabling usage of unique rules out of the model as well See buildUniqueExclusionRules() doc for details --- src/Ardent/Ardent.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Ardent/Ardent.php b/src/Ardent/Ardent.php index e15e508..0470ef8 100755 --- a/src/Ardent/Ardent.php +++ b/src/Ardent/Ardent.php @@ -800,18 +800,16 @@ protected function hashPasswordAttributes(array $attributes = array(), array $pa } /** - * When given an ID and a Laravel validation rules array, this function - * appends the ID to the 'unique' rules given. The resulting array can - * then be fed to a Ardent save so that unchanged values - * don't flag a validation issue. Rules can be in either strings - * with pipes or arrays, but the returned rules are in arrays. - * - * @param int $id + * Appends the model ID to the 'unique' rules given. The resulting array can + * then be fed to a Ardent save so that unchanged values don't flag a validation + * issue. It can also be used with {@link Illuminate\Foundation\Http\FormRequest} + * to painlessly validate model requests. + * Rules can be in either strings with pipes or arrays, but the returned rules + * are in arrays. * @param array $rules - * * @return array Rules with exclusions applied */ - protected function buildUniqueExclusionRules(array $rules = array()) { + public function buildUniqueExclusionRules(array $rules = array()) { if (!count($rules)) $rules = static::$rules;