My variable carType gets a string value.
If additionalFields variable is carType should be required when it is a truck or caravan. If carType is a truck, then additionalFields should be a array.
'carType' => 'string',
'additionalFields' => 'required_if:carType,truck,caravan',
How do i add an array validation based on condition?
from Newest questions tagged laravel-5 – Stack Overflow https://ift.tt/3BZQ0wz