Mike Rockétt Systems Developer & Designer @ Megafreight
← Open Source

Laravel Permissions

Home/Repo Link



Lighning-fast command line tool that sets the correct permissions on a Laravel project in a Linux environment. This is an opinionated tool, and assumes that you follow the domain-user approach to virtual hosts. That is, each virtual host has its own system user.

Run with V

$ v run laravel_permissions.v
  1. Type in the owner domain-user
  2. Type in the web server user group (defaults to www-data)
  3. Watch it fly:
running preflight checks
os supported
running as root
preflight checks complete
answer the following prompts, or type exit, quit, or q to quit.
? owner user (domain-user) required domain.com
? group (web-server user) www-data
→ adding owner to web-server group…
→ applying group and owner to /home/domain.com/www…
→ setting file permissions to 660…
→ setting directory permissions to 2770…
→ setting web-server group on storage and bootstrap/cache directories…
→ setting ug+rwx permissions on storage and bootstrap/cache directories…

Build for Production

$ v -prod -os linux

This will create a binary called laravel_permissions.

You can now dump this binary on your server however you see fit.