I'm running into some issues with validating a FormRequest. I have a rule that checks for the existence of a particular field:
public function rules(): array
{
return [
'code' => 'bail|required|string|exists:promotions',
];
}
I then have several other validations in the public function after() array of callables.
Unfortunately it seems like bail isn't working, because when I enter a non-existent value, one of the after() callables errors out because it can't find a promotion with the given code.
Am I misunderstanding how rules and after are evaluated?