Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Commit 028044d

Browse files
committed
Enabling usage of unique rules out of the model as well
See buildUniqueExclusionRules() doc for details
1 parent 73fba06 commit 028044d

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/Ardent/Ardent.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -800,18 +800,16 @@ protected function hashPasswordAttributes(array $attributes = array(), array $pa
800800
}
801801

802802
/**
803-
* When given an ID and a Laravel validation rules array, this function
804-
* appends the ID to the 'unique' rules given. The resulting array can
805-
* then be fed to a Ardent save so that unchanged values
806-
* don't flag a validation issue. Rules can be in either strings
807-
* with pipes or arrays, but the returned rules are in arrays.
808-
*
809-
* @param int $id
803+
* Appends the model ID to the 'unique' rules given. The resulting array can
804+
* then be fed to a Ardent save so that unchanged values don't flag a validation
805+
* issue. It can also be used with {@link Illuminate\Foundation\Http\FormRequest}
806+
* to painlessly validate model requests.
807+
* Rules can be in either strings with pipes or arrays, but the returned rules
808+
* are in arrays.
810809
* @param array $rules
811-
*
812810
* @return array Rules with exclusions applied
813811
*/
814-
protected function buildUniqueExclusionRules(array $rules = array()) {
812+
public function buildUniqueExclusionRules(array $rules = array()) {
815813

816814
if (!count($rules))
817815
$rules = static::$rules;

0 commit comments

Comments
 (0)