Skip to content

ACCESS DENIED #7

@Tarcisiofl

Description

@Tarcisiofl

Hello, I was following your tutorial from https://scotch.io/tutorials/user-authorization-in-laravel-54-with-spatie-laravel-permission. Then, I create a seed as below:

class PermissionSeeder extends Seeder
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        app()['cache']->forget('spatie.permission.cache');

        // Project
        Permission::create(['name' => 'edit projects']);
        $permission = Permission::create(['name' => 'admin permissions']);

        $role = Role::create(['name' => 'admin']);
        $role->givePermissionTo($permission);

        Role::create(['name' => 'client']);
    }
}

The user has the 'admin permissions", but still return access denied!

Regards!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions