1cd [..LARAVEL PROJECT ROOT]
2sudo find . -type f -exec chmod 644 {} \;
3sudo find . -type d -exec chmod 755 {} \;
4sudo chmod -R 777 ./storage
5sudo chmod -R 777 ./bootstrap/cache/
1sudo chmod -R 777 path/to/root
2sudo chown -R www-data:www-data /path/to/root
3sudo usermod -a -G www-data ubuntu
4sudo find /path/to/root -type f -exec chmod 644 {} \;
5sudo find /path/to/root -type d -exec chmod 755 {} \;
6sudo chgrp -R www-data storage bootstrap/cache
7sudo chmod -R ug+rwx storage bootstrap/cache
1sudo chgrp -R www-data storage bootstrap/cache
2sudo chmod -R ug+rwx storage bootstrap/cache
1cd /path/to/root;
2sudo chmod -R 777 ./
3sudo chown -R www-data:www-data ./
4sudo usermod -a -G www-data ubuntu
5sudo find ./ -type f -exec chmod 644 {} \;
6sudo find ./ -type d -exec chmod 755 {} \;
7sudo chgrp -R www-data storage bootstrap/cache
8sudo chmod -R ug+rwx storage bootstrap/cache
1//install laravel permission with composer installer for Laravel 6.0 or higher
2composer require spatie/laravel-permission
3php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
1protected $routeMiddleware = [
2 // ...
3 'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class,
4 'permission' => \Spatie\Permission\Middlewares\PermissionMiddleware::class,
5 'role_or_permission' => \Spatie\Permission\Middlewares\RoleOrPermissionMiddleware::class,
6];
7