I have a user database table that stores user roles. I need to validate if the user is either one of two roles in that table. Normally I could use exists but in this case, I need to check between two values.
How do I create a custom validation to do this? (I've an existing CustomValidator class)
E.g.
protected function validateUserRole($attribute, $value) {
return (bool) ;
}
Columns in User role table:
id | user_id | role_id
Laravel rules:
$rules = array(
'user_id' => ?
);
Thanks!