Skip to content

Commit

Permalink
make sometimes() chainable (#17241)
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid authored and taylorotwell committed Jan 10, 2017
1 parent d5ea2e0 commit e280da9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Illuminate/Validation/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ protected function addRules($rules)
* @param string|array $attribute
* @param string|array $rules
* @param callable $callback
* @return void
* @return $this
*/
public function sometimes($attribute, $rules, callable $callback)
{
Expand All @@ -770,6 +770,8 @@ public function sometimes($attribute, $rules, callable $callback)
$this->addRules([$key => $rules]);
}
}

return $this;
}

/**
Expand Down

0 comments on commit e280da9

Please sign in to comment.