-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using UUid instead of Native ID's #793
Comments
A better check would be Would be nice to be able to have a PK name |
I had a quick look while doing the other PR, but that is clearly another story :) One would need:
Currently slightly out of time for that. But I will consider having a look when I get some time. Our current application is using regular IDs for roles/permissions. And on the user side, we only refer to names (never IDs), hence the switch to IDs for those 2 models is not critical to us for now. |
Closing because there are no plans to implement this at this time. |
Hi,
I have updated my migrations to accept uuids instead of ids but when giving roles to users or giving permissions to roles, these two pieces occur issue because uuids appear like names:
Spatie\Permission\Traits\HasRoles
and
Spatie\Permission\Traits\HasPermissions
So I added a custom trait to my Role model as below to solve this issue:
I am sure
if (strlen($permissions) == 36) {
is not the best practice, but as a temporary solution it worked for me.Thanks for this great work.
The text was updated successfully, but these errors were encountered: