Skip to content

Instantly share code, notes, and snippets.

@allysonsilva
Created April 27, 2018 01:37
Show Gist options
  • Save allysonsilva/89cdcc312a989f2261d236ae1a1dd0dc to your computer and use it in GitHub Desktop.
Save allysonsilva/89cdcc312a989f2261d236ae1a1dd0dc to your computer and use it in GitHub Desktop.
⚡️ Laravel Permissions
## Optional: if you've been playing around with permissions consider resetting all files and directories to the default.
sudo find ./ -type d -exec chmod 755 {} \;
sudo find ./ -type f -exec chmod 644 {} \;
## Give users part of the laravel group the standard RW and RWX permissions for the existing files and folders respectively.
sudo find ./storage -type d -exec chmod 775 {} \;
sudo find ./bootstrap/cache -type d -exec chmod 775 {} \;
sudo find ./storage -type f -exec chmod 664 {} \;
sudo find ./bootstrap/cache -type f -exec chmod 664 {} \;
## Give the newly created files/directories the group of the parent directory e.g. the laravel group.
sudo find ./bootstrap/cache -type d -exec chmod g+s {} \;
sudo find ./storage -type d -exec chmod g+s {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment