|
|
|
@ -21,6 +21,20 @@ abstract class BaseController
|
|
|
|
return $this->service;
|
|
|
|
return $this->service;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected function validated(array $rules): array
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$request = $this->getRequest();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$validator = $this->validator->make(
|
|
|
|
|
|
|
|
$request->all(),
|
|
|
|
|
|
|
|
$rules,
|
|
|
|
|
|
|
|
$request->messages(),
|
|
|
|
|
|
|
|
$request->attributes()
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
$validator->validate();
|
|
|
|
|
|
|
|
return $validator->validated();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected function getRequest(): FormRequest
|
|
|
|
protected function getRequest(): FormRequest
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return $this->request;
|
|
|
|
return $this->request;
|
|
|
|
|