thevelooper's avatar

Validate 2 fields and 2 columns at once

I have 2 fields in my form ,

    $query->product_id = $request->input('productid');
    $query->store_id = $request->input('storeid');

1 product cannot be saved in one store twice, but can be saved in different stores, I want to validate this and I don't know how to do this, I'd be appreciated for your help

0 likes
3 replies
thevelooper's avatar

Thanks, I didn't even know this package was existed

Tray2's avatar

I do this in one of my validations.

It validates the first and the last name of an author.

 $rules = [
            'first_name' => 'required|unique:authors,first_name,' . null . ',id,last_name,'. $this->last_name,
            'last_name' => 'required',
        ];
1 like

Please or to participate in this conversation.