Level 8
'type' => 'required|in:company,reseller,main'
2 likes
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi,
i have a qustion , am going to validate form requiest and am looking to do something like
$this->validate($request, [
'imei' => 'required',
'company' => 'required|exists:company,id',
'sender' => 'required',
'type' => 'required',
]);
what i want to validate is the request ->type , i have array like ['company','reseller','main'] and the validation is required and it should be one of this values in array.
is there is way to do that ? or if i can add something like bellow
'type' => 'required|same:company,reseller,main'
'type' => 'required|in:company,reseller,main'
Please or to participate in this conversation.