0

I want to save my images that modified by image intervention in storage folder in my Laravel project.
Storage::put() this works fine and saves images in storage folder (my local OS is windows 10), but not working in server OS(CentOS 8). storage folder permissions is 755 i've tried 777 but not worked too. Here is my code:

$filename = basename($request->tutorialImage);
$image = Image::make($request->tutorialImage)->resize(300, 400);
$image->stream();
Storage::disk('local')->put('files/shares/resizedImages/' . $filename . '-' . 300 . '-' . 400. '.jpg', $image);

I've already ran command php artisan storage:link too.

Nima Tf
  • 61
  • 1
  • 8
  • Make sure the directory/file names are exactly the same as on the disk, Windows is not case sensitive - linux is. – Nigel Ren Nov 06 '21 at 08:06

1 Answers1

2

use this

chown -R $USER:www-data bootstrap/cache
chown -R $USER:www-data storage
chown -R $USER:www-data resources/views
chown -R $USER:www-data public/files

chmod -R 775 storage
chmod -R 775 bootstrap/cache
chmod -R 775 resources/views
chmod -R 775 public/files
Hossein Piri
  • 716
  • 1
  • 7
  • 15