Laravel 5.8 - Validation - pass value of one input to validate another

Asked

Viewed 127 times

2

I would like to check if there is a possibility in the formRequest validation to pass the value of one input as a parameter to validate another. Example: Inputs 'company_id', 'email' in formRequest I would like to pass the value of company_id in a custom validation.

inserir a descrição da imagem aqui

'test' is my custom validation and as parameter I would like it to be the value of the input 'company_id', but this way it sends as parameter a string with the value = 'company_id'.

The validation I want to do is single email to the company ID. The email can repeat however not with same company ID.

1 answer

0

I solved the problem by assigning the value of the input in a variable and passing as parameter as image. inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.