0👍
✅
Added new error message in validator message bag
$validator->getMessageBag()->add('error', 'Your message here');
return response()->json(array('error' => $validator->getMessageBag()->toArray()), 400);
Pass single message like this
$error_message = array('slot-time' =>'Slot end time should be greater than start time');
return response()->json(array('error' => $error_message), 400);
Source:stackexchange.com