Skip to content
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

Can no longer delete permissions returned by "findByName" #2758

Closed
Sfonxs opened this issue Nov 8, 2024 · 1 comment · Fixed by #2759
Closed

Can no longer delete permissions returned by "findByName" #2758

Sfonxs opened this issue Nov 8, 2024 · 1 comment · Fixed by #2759

Comments

@Sfonxs
Copy link

Sfonxs commented Nov 8, 2024

Description

Before when doing:
$permission = Permission::findByName($name, $guardName);

And then calling:
$permission->delete()

The permission would be correct deleted.

Now this no longer happens because the "$exists" property on the permission model being false instead of true.

This behavior has changed since version 6.10.0, worked fine in 6.9.0.

Steps To Reproduce

  1. $permission = Permission::findByName($name, $guardName);
  2. $permission->delete()
  3. Notice the permission is not deleted.

Example Application

No response

Version of spatie/laravel-permission package:

6.10.0

Version of laravel/framework package:

11.30.0

PHP version:

8.3

Database engine and version:

singlestore

OS: Windows/Mac/Linux version:

Ubuntu

@erikn69
Copy link
Contributor

erikn69 commented Nov 8, 2024

Hi, try #2759

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants