mardi 11 juillet 2017

Laravel - Convert Intervention Image Model(\Intervention\Image\Image) to UploadedFile model (\Illuminate\Http\UploadedFile)

The second parameter of the Storage::put method accept only \Illuminate\Http\UploadedFile(or File) model. How can i convert \Intervention\Image\Image to UploadedFile without save/send to storage?

if($request->hasFile('image')) {
  $image = $request->file('image');
  $image_resize = Image::make($image->getRealPath());
  $image_resize->resize(300, 300);
  $image_resize->encode();
  $imagePath = Storage::put(public_path(), new File($image_resize), 'public');
}



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2uNYKo6
via IFTTT

Aucun commentaire:

Enregistrer un commentaire