Last Updated: 2021-05-15
Validation for presence is ambiguous when working with key/value structures.
I had the following Laravel validation in a controller:
<? php $request->validate([ 'plan_name' => 'required', ]);
The validation was passing - even though
plan_name was undefined. This was
plan_name KEY was present in the request, but its VALUE had been set
What I realy wanted was to ensure additionally that
plan_name, the key itself, was
present too (i.e. not null).