Replies: 1 comment
-
It is working for me, make a failing test for look at laravel-permission/tests/HasPermissionsTest.php Lines 220 to 229 in 6a3ed62 Also the associated role and permission never get deleted, only detached |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When I delete a user using:
or
it doesn't delete the roles or permissions associated with the $user.
If I delete the permissions and/or roles from the
$user
directly through detach, prior to deleting the user, the associated permission and role records do get deleted as desired...Looking at the traits for Permissions and Roles, it looks like this should be handled automatically with
$user->delete()
. Here is a snippet from/spatie/laravel-permission/src/Traits/HasPermissions.php
which I believe should be causing these related records to be deleted, but it isn't...Am I missing something? I can certainly just detach directly prior to deleting the
$user
as I mentioned above, but I'd like it to work as expected and take care of the detaching automatically. Any ideas?Beta Was this translation helpful? Give feedback.
All reactions