Support the ongoing development of →
Validation Requests Laravel
Last updated 2 years ago.

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,
Last updated 7 years ago.

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!


Your banner here too?

Bogdan P. melokki Joined 26 Jun 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.