Reputation: 8350
I have a title attribute in my list of field to validate, instead of checking if it's a string, how can I check that it's equal either to M
or MME
?
$attributes = [
'title' => ['string']
];
$validator = Validator::make($request->user, $attributes);
Upvotes: 0
Views: 999
Reputation: 1325
You can use the 'in' validation rule.
'title' => ['in:M,MME'],
https://laravel.com/docs/master/validation#rule-in
Upvotes: 3