Skip to content

Specified role id does not exists #1

@mybigman

Description

@mybigman

Hi,

Decide to give you package a run as it seems to fit the bill :)

/*$role = new \App\Modules\Base\Models\Role();

$roleAdmin = $role->create([
    'name' => 'Administrator',
    'slug' => 'administrator',
    'description'=>'manage administration privileges'
]);*/

$user = \App\User::find(1);

// assign role by just a slug
$user->assignRole('administrator');

dd($user);

The assignRole fails with...

InvalidArgumentException in HasRole.php line 158: Specified role id does not exists.

Any ideas @kodeine ?

Thanks.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions