This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

Vijay Wilson
Vijay Wilson

I have a backend form in my model, with "unique" validation rule, the validation works good when a new record is being created but when the same record is being updated the "unique" validation fails to include all the where conditional clauses.

public function beforeValidate()
{
    $this->rules['product_name'] = 'required|unique:products,product_name,NULL,id,product_type_id,'.$this->product_type_id.',product_for,'.$this->product_for;      
}

Above "unique" validation rule performs perfectly for creating a new record, but while updating a new record it fails to include the conditional clause for "product_for" column

1-1 of 1

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.