Вы можете использовать следующее
use Illuminate\Validation\Rule;
//..
if(!$request->filled('roles')) {
$request->merge(['roles' => []]);
}
$this->validate($request,[
'name' => 'required',
'email' => 'required|email', //'required|email|unique:users,email',
'password' => [ 'string', 'min:8'],
'roles' => 'nullable|array',
'roles.*' => [Rule::requiredIf($request->filled('roles')), 'exists:roles,id'],
],[
'name.required' => "Name field is required",
'email.required' => "Email Field is Required",
'email.email' => "Invalid Email Format ",
'password.min' => "The Password Must be at Least 8 Characters or More",
'roles.*' => "The Role is Required",
]);
//...