dimanche 26 août 2018

Laravel Validate if there is already a record with similar combination of two columns

For example, I have an auction where Users can bid on items.

When a user creates a new bid I want to be sure that this user didn't bid on this item before.

The BID table structure is id, item_id, user_id, price. So basically I need to check if there is a record that has same item_id and same user_id at the same time.

Is there any way to do this using Laravels Validator?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire