Published 8 months ago by codemode
In my controller i'm doing some validation like :
$this->validate(request(), [ 'add_button' => 'required|integer|notIn:'.$requested_by ], [ 'notIn' => 'This value has to be different' ]);
...this is in reference to the following format :
$this->validate($request, $rules, $customMessages);
So, i'm using the "notIn" validator to check that the "add_button" value is not equal to "$requested_by"
Though the validation works, but the custom message is not not displayed. On the contrary, if i put a custom validation message for "required" or something like "max" - then the custom validation message is displayed just fine.
Where am i going wrong?