I have code in Request class:
public function rules()
{
return [
'id' => 'required|check_xxx',
];
}
public function attributes()
{
return [
'id' => 'AAA',
];
}
As you can see. I have cusom validation method name check_xxx. This method in inside class CustomValidator.
So, I have code:
class ValidationServiceProvider extends ServiceProvider
{
public function boot()
{
$this->app->validator->resolver(function ($translator, $data, $rules, $messages) {
return new CustomValidator($translator, $data, $rules, $messages);
});
}
}
And error message for required is: Please input :attribute
But I got the message: Please input id, (TRUE is: Please input AAA)
I discovered that $this->app->validator->resolver make attributes() method in Request is useless.
How can I fix that? Thank you.