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

[BUG]: Prunable / MassPrunable trait not working - undefined event() function #103

Open
rafaucau opened this issue Dec 23, 2024 · 1 comment
Assignees
Labels
bug Something isn't working v4
Milestone

Comments

@rafaucau
Copy link
Contributor

Describe the bug

Error occurs when using Eloquent's Prunable trait due to missing event() helper function.

PHP Fatal error:  Uncaught Error: Call to undefined function Illuminate\Database\Eloquent\event() in /var/www/html/vendor/illuminate/database/Eloquent/MassPrunable.php:32

Steps to reproduce the issue

  1. Use Prunable or MassPrunable trait in a model (https://laravel.com/docs/11.x/eloquent#pruning-models)
  2. Call pruneAll() method
  3. Error: Call to undefined function Illuminate\Database\Eloquent\event()

Your setup

  • WordPress Version: 6.7.1
  • Module version: 4.0.0
  • Are you using framework?: Bedrock

Additional context

The event() helper function isn't included in standalone Eloquent ORM. Need to implement this helper or modify the trait to work without the event system.

@rafaucau rafaucau added the bug Something isn't working label Dec 23, 2024
@dimitriBouteille dimitriBouteille added this to the 4.1.0 milestone Dec 28, 2024
@dimitriBouteille
Copy link
Owner

Hi @rafaucau

Thanks for the details. I look to fix this bug as quickly as possible, you will be informed when it is done.

Best,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v4
Projects
None yet
Development

No branches or pull requests

2 participants