M
M
maddog6702022-04-20 20:58:58
Laravel
maddog670, 2022-04-20 20:58:58

How to write validation rule for single user with status?

Who can tell me, I can’t figure out how to write a validation rule. There are drivers and there is a payment, you need to validate the application, so that there is only one application for payment to the driver with the status in processing, but if the application is processed, can you create another one?
Driver - driver_id
Status - enum status

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pLavrenov, 2022-04-20
@pLavrenov

The validator handler should only return true or false. Actually you check on the necessary conditions and if everything is normal you return true. If such a request already exists, return false.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question