Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

fredemagi's avatar

How to set folder permissions for public users' folder?

I'm making an app where people can sign up, edit their user's profile etc. When people I sign up, I make a new folder for their images like this:

Storage::disk('public')->makeDirectory('user-images/'.$external_id);

user-images is located in storage/app/public. A symbolic link connects the path with public/storage. However, when new users signs up, either the new folder is created, nor can they upload images. I think it has something to do with wrong persmissions.

I'm fairly new to Laravel Forge which I use along with Digitalocean. What do I do to allow this? Can I change something in the code, or do I have to set permissions somewhere?

0 likes
3 replies
DevMaster's avatar

Do you have SSH access to you webserver?

It sounds like a permissions problem with storage/app/public or possibly an issue with the symlink.

fredemagi's avatar

@DEVMASTER - I do have access. I have also made the php artisan symlink command to create the link between public and storage. It is normal procedure to run the symlink command through every auto deployment or just one time?

DevMaster's avatar

Creating the symlink should be a one-time thing

Please or to participate in this conversation.