Use Request validation without injection (directly in controller)
I try to use my request class validation directly in my controller without injection.
So i think i need to create a request instance and after use it for to proceed to validation.
My request validation class is PublieArticleRequest
And in my controller i do
public function statutpublie(Centre $centre)
{
$centre9 = $centre->toArray();
$request = new Request();
$request->request->add($centre9);
$request = app('App\Http\Requests\Backend\PublieArticleRequest');
//my stuff if validation is OK
}
The validation takes place but all the rules are announced as bad and they are all good in real.
I do not know if the method is the right one. I just want to run a validation using an already existing class. But in my case the user click on a button, it does not send the complete form. I am therefore with a method get that prevents me to use the injection.
Please or to participate in this conversation.