I am having the hardest time resizing an image with Laravel Image Intervention. I am able to name and save images normally, but when I add image intervention it won't save the new file created to the folder.
Here is what I have in my controller
//This all works
$title = str_slug(request('title'));
$filenameWithExt = $request->file('cover_image')->getClientOriginalName();
$filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);
$extension = $request->file('cover_image')->getClientOriginalExtension();
$fileNameToStore= $title.'.'.$extension;
$thumbnailpic= 'thumb'.'-'.$fileNameToStore;
//store image
$path = $request->file('cover_image')->storeAs('public/cover_images', $fileNameToStore);
//Here is where I am trying to resize and it breaks
$file = Input::file('cover_image');
Image::make( $file->getRealPath() )->fit(340, 340)->save('public/cover_images/' . $thumbnailpic);
This is the error I get
"Can't write image data to path (public/cover_images/thumb-imagename.png)"
If I remove the two lines of resize code everything works perfectly. I am running this locally and have made everything open completely for permissions. Not sure what else to do. Thanks!
cover_images
exist? – Rwd->save('public/cover_images/' . $thumbnailpic)
, for Intervention I believe this path starts in the Linux root. – user2094178