Reputation: 21
in my controller i have this validator
...
$request->validate([
'id' => ['bail', 'required', 'string'],
'live' => [Rule::in(['yes', 'no'])],
]);
...
and my response if the rule Rule::in fails is this
{
"message": "The given data was invalid.",
"errors": {
"live": [
"The selected live is invalid."
]
}
}
now my question is how can I return the possible values of Rule:in within that response? in this case: "yes" and "no"
Upvotes: 2
Views: 484