UPDATE - SOLUTION I opened an issue on their github page: https://github.com/spatie/laravel-permission/issues/1398#issuecomment-594032058
All I had to do is change the change the 'model_morph_key' type, in the migrations, to mach the type of my User model's primary key.
This is my first post on Stackoverflow, so apologies for the poor structure
I'm using this Laravel package: https://github.com/spatie/laravel-permission
I'm trying to give Admin permissions to a specific user by assigning a role to the user.
The issue: The role/permissions are assigned to the entire User Model instead of that specific user.
Has anyone faced anything similar? I wasn't able to find anything online. Keep in mind that my User Model is not using an auto-increment a number as a unieque ID. Could this be the cause of the issue?
Code
// Creates Admin Role
$admin_role = Role::create(['name' => 'Admin']);
// Assigning Permissions to Roles
$admin_role->givePermissionTo($access_admin_panel);
$admin_role->givePermissionTo($change_user_roles);
// Assigning role to user
auth()->user()->assignRole('Admin');
Thanks.