// if there are no `available` keys found in `cars` request, set the first item to true
if(!collect($request->input('cars'))->contains('available', true)) {
$request['cars'][0] = ['available'=>true];
}
But I'm getting Indirect modification of overloaded element.... I can use collect(...)->transform(...) but is there a shorter and faster way of doing it.