Laravel validation: exists with additional column condition - custom validation rule
问题 Is there is a way of referencing another field when specifying the exists validation rule in Laravel? I want to be able to say that input a must exist in table a, input b must exist in table b AND the value for column x in table b must equal input a. Best explained by example: public $rules = array( 'game_id' => 'required|exists:games,id', 'team1_id' => 'required|exists:teams,id,game_id,<game_id input value here>', 'team2_id' => 'required|exists:teams,id,game_id,<game_id input value here>' );