I want to validate two fields i.e. 'type' and 'options' where 'type' field is enum. The 'options' field should be validated only if the value of 'type' field is 'opt'.
$this->validate($request, [
'type' => 'required|in:opt,number,text,file,image',
'options'=>the condition I need(if type is 'opt')
]);