In laravel docs, it is recommended that you add validation rules to the array when they get larger, and I thought 3 rules were sufficient. I think this makes it for more readable content, but you don't need it. I added the regex part below, and it works for me. I am not so good at regular expressions. Let me know.
$validator = Validator::make($credentials, [ 'profile' => ["required" , "max:255", "regex:(married|single|gay)"] ]);
source share