lundi 4 mai 2020

How to use Request file without using it in Laravel function parameter

I have request file that I use for validation and other codes for my request. And I have some instance that I want to also use the request file. Normally I did it like this:

public function myFunction(RequestFile $request)
{
    ...doing the intended actions
}

On the other hand I tried to doing it like this to use my request file but it is not working:

public function myFunction()
{
    $newData = new RequestFile($data);
}

Is this the right way to use my request file when not using it in my function parameter?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire