Write dynamic validation rules when saving a model
0
public function beforeValidate()
{
$this->rules['amount_picked'] = 'numeric|min:0|max:' . $this->amount_required;
}
Simple and to the point. Optimized by the community.
public function beforeValidate()
{
$this->rules['amount_picked'] = 'numeric|min:0|max:' . $this->amount_required;
}
There are no comments yet
Be the first one to comment