Can you give me advice what to do. I am following this tutorial: Laravel 5.6 - User Roles and Permissions (ACL) using Spatie Tutorial
All good. But in the end, I have only access to users
page and cannot create new user because there are not roles in the list. In the pages - products
and roles
gives me a message from the handler: ["User have not permission for this page access."]
I have only permission seeds:
<?php
use Illuminate\Database\Seeder;
use Spatie\Permission\Models\Permission;
class PermissionTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$permissions = [
'role-list',
'role-create',
'role-edit',
'role-delete',
'product-list',
'product-create',
'product-edit',
'product-delete'
];
foreach ($permissions as $permission) {
Permission::create(['name' => $permission]);
}
}
}
I can give you more code if you wish from the project.