0

I am trying to save images in /public/storage/photos. Until now everything worked locally but I switched to production on my remote machine and I can't create the photo in my folder but I store its name in my sql table. I first thought it was a problem related to the right but it's not that (I did a chmod 777 to be sure). So I really don't see where it comes from, any idea?

$validated = $this->validate([
'photo' => 'image|max:2048',
]);
$name = $id.'_'.md5($mission->name).'id_1'.'.'.$this->photo->extension();
$this->photo->storeAs('photos', $name, 'public');
Furnaxe
  • 1
  • 5

2 Answers2

0

In your .env file, do you have FILESYSTEM_DRIVER set to something other than "local"?

Magmatic
  • 1,754
  • 3
  • 19
  • 34
-1

it seems that your code works, please run & check

php artisan storage:link 
Omar Tammam
  • 1,217
  • 1
  • 9
  • 17