mercredi 24 janvier 2018

laravel 5.5 storeAs not work well

I need to save an image, consider that the image arrive correctly from a request, after that I need to save in storage/app.

Below the code in controller class:

public function getImage(ImageRequest $request)
{
      $file = $request->file('image');
      $path = $request->image->storeAs( 'images','img.jpg','local');

}

i see this error without nothing saved:

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Call to a member function storeAs() on null



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire