Skip to content

Unabel to assign roles using Tinker or Tinkerwell #657

@krismanning

Description

@krismanning

I have a problem adding roles to users either using Tinkerwell or Artisan Tinker using my production instance. The user is already an admin and I want to add an additional role to the user.

$kris = User::find(1);
$kris->assign("Editor+");
Bouncer::refresh();
$kris->getRoles();

Output:-

Illuminate\Support\Collection#3842 ▼
  all: array:1 [▼
    0 => "Admin"
  ]
}

This doesnt happen on my local dev environments (Windows or MacOs) where it works as expected. I havent tried adding the role through code yet but will do so asap.

And any ideas why this works in dev but not in prod?

Any help would be appreciated.

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