-
-
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
[v6] Possible bug on $user->syncRoles($array) #2530
Comments
I think the PR #2423 has something to do with this error. Let me say it again, the role exists. |
Well, resolved the problem by using The same logic can be applied to |
No, here #2089 The functionality could be changed, |
Is there something we should add to the upgrade docs to clarify this? |
If my memory serves me right, this was always how it worked. |
Don't sea the answer my question |
@mohammedALhakmy what question?? I don't see any comments from you |
There is no permission named 1 for guard web. this is error |
There is no permission named `4` for guard `web`.
i have this error with the in edit or store the users and roles why can
help me because 2 days with the error 😭😭😭😭
في الاثنين، 6 نوفمبر 2023 في 11:08 م تمت كتابة ما يلي بواسطة erikn69 <
***@***.***>:
… @mohammedALhakmy <https://github.com/mohammedALhakmy> what question?? I
don't see any comments from you
—
Reply to this email directly, view it on GitHub
<#2530 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYQ5WLYTDLZDENOD5WTEJP3YDE7SHAVCNFSM6AAAAAA6PG2F56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJWGMYDSNRVHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
It appears that your application is sending Either pass an |
It's always helpful when you provide actual code from your application. Without seeing your code it is much more difficult to give specific answers. |
If you are assigning permissions based on end-user selection in a form, I am guessing that you are sending the permission ID to the form as a checkbox or dropdown, but when you receive the Request data you are not converting those Permission IDs back to |
this function with store roles and seam error with store ,edit users olsa store and edit rolse but this function store roles
|
If you |
this answer |
Notice that |
don't show error but not insert any check role just insert name role not check roles why |
Calling $role->syncPermissions() without any permission parameters will simply remove all permissions from the $role. |
what is the correct solution and code |
Question: When those numeric $role->syncPermissions(array_map(fn($val)=>(int)$val, $request->input('permission'))); or $role->syncPermissions(collect($request->input('permission')->map(fn($val)=>(int)$val))); |
thank you so much,it is the correct is very good🤩🤩🤩🤩 |
THANKS my issue solved : $permissionIds = collect($request->input('permission'))->map(fn($val) => (int)$val)->all(); |
thank you this worked for me!! |
Describe the bug
Hello, after upgrading to v6, I can't sync an array of role ids to an user.
As far I know, the v6 doesn't break the sync() method right? Am I missing something?
Versions
PHP 8.2
laravel , permissions, etc -- latest to date
Here is my example code and/or tests showing the problem in my app:
#2529
The text was updated successfully, but these errors were encountered: