You can try like this
Include use first as below in your form request
use Illuminate\Contracts\Validation\Validator;
use Illuminate\Http\Exceptions\HttpResponseException;
and then
protected function failedValidation(Validator $validator) {
throw new HttpResponseException(response()->json($validator->errors(), 422));
}
now if you try to validate then it will return like
{
"title": [
"The title field is required."
]
}