Hi Bogdan,
At the moment there's no way to write it like that. You could wrap the rules in a variable so you don't need to edit it twice.
$nameRules = 'required|max:255';
$rules = [
'bride_first_name' => $nameRules,
'groom_first_name' => $nameRules,
];
Or you could create a custom rule that says 'required_and_max_255' if you need this combination a lot.
Thank you very much guys for your answers. I'll go with a custom validation rule for this.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community