October CMS resources and help articles

Simple and to the point. Optimized by the community.

Write dynamic validation rules when saving a model

0
by xyz.qtc, last modified on February 13th, 2024
    public function beforeValidate()
    {
                $this->rules['amount_picked'] = 'numeric|min:0|max:' . $this->amount_required;
    }

Discussion

0 comments

We use cookies to measure the performance of this website. Do you want to accept these cookies?