xxxxxxxxxx
cd /var/www/html/website
sudo chmod -R 755 bootstrap/cache
sudo chmod -R 755 storage
sudo find /var/www/html/website -type f -exec chmod 644 {} \;
sudo find /var/www/html/website -type d -exec chmod 755 {} \;
sudo chgrp -R apache storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
xxxxxxxxxx
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
xxxxxxxxxx
cd /path/to/root;
sudo chmod -R 777 ./
sudo chown -R www-data:www-data ./
sudo usermod -a -G www-data ubuntu
sudo find ./ -type f -exec chmod 644 {} \;
sudo find ./ -type d -exec chmod 755 {} \;
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
xxxxxxxxxx
sudo chmod -R 755 ./storage
sudo chmod -R 755 ./bootstrap/cache/
Or
sudo chgrp -R www-data ./storage ./bootstrap/cache
sudo chmod -R ug+rwx ./storage ./bootstrap/cache
xxxxxxxxxx
chmod 777 storage -R
sudo chcon -t httpd_sys_rw_content_t storage -R
chmod 777 bootstrap
sudo chcon -t httpd_sys_rw_content_t bootstrap -R
xxxxxxxxxx
//install laravel permission with composer installer for Laravel 6.0 or higher
composer require spatie/laravel-permission
php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
xxxxxxxxxx
protected $routeMiddleware = [
// ...
'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class,
'permission' => \Spatie\Permission\Middlewares\PermissionMiddleware::class,
'role_or_permission' => \Spatie\Permission\Middlewares\RoleOrPermissionMiddleware::class,
];
xxxxxxxxxx
SPATIE LARAVEL PERMISSION
https://github.com/spatie/laravel-permission
BOUNCER
https://github.com/JosephSilber/bouncer