How to return custom error message from controller method validation

to get custom error message you need to pass custom error message on third parameter,like that

$this->validate(
    $request, 
    ['thing' => 'required'],
    ['thing.required' => 'this is my custom error message for required']
);

Leave a Comment