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 package
2composer require spatie/laravel-permission
3
4// config/app.php
5'providers' => [
6 // ...
7 Spatie\Permission\PermissionServiceProvider::class,
8];
9
10// Publish config file
11php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
12
13// Clear cache
14php artisan optimize:clear
15 # or
16php artisan config:clear
17
18// Run migration to create tables
19php artisan migrate
20
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
1Could be that although you have 755/777 permissions, SELinux is blocking httpd from writing/creating dirs.:
2chcon -R -t httpd_sys_content_t /var/www/html
3sudo chcon -R -t httpd_sys_rw_content_t /var/www/mrr/public/textpipe
4
5sudo chgrp apache -R /var/www/html/files
6chmod g+s .
7