vendredi 10 juillet 2020

Laravel exist validation - combination of column

I have two tables one is banking and another one is a type (banking types). banking table has many types and types that belong to banking. once I create the account, I need to validate banking type_id and banking_id in the types table (i need to validate banking id and type id at the same time for avoiding user enter the wrong combination of banking and type). How can I do that with Laravel validation? both columns required and need to implement above scenario.

Types table.

enter image description here

current validation.

'type_id' => 'required|exists:types,id',
'banking_id' => 'required|exists:bankings,id',


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/38Hjdzy
via IFTTT

Aucun commentaire:

Enregistrer un commentaire