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

Delete all notifications throws an error #6653

Closed
niekdemelker opened this issue Jan 7, 2025 · 0 comments
Closed

Delete all notifications throws an error #6653

niekdemelker opened this issue Jan 7, 2025 · 0 comments
Labels
bug Verified bug by the Nova team fix incoming A fix is in review
Milestone

Comments

@niekdemelker
Copy link

niekdemelker commented Jan 7, 2025

  • Laravel Version: v11.37.0
  • Nova Version: v5.0.7 (Silver Surfer)
  • PHP Version: v8.3.15

Description:

If you have some notifications in Nova and want to delete them all at once, you will get an error:

Call to a member function afterResponse() on null {"userId":1,"exception":"[object] (Error(code: 0): Call to a member function afterResponse() on null at /site/vendor/laravel/nova/src/Http/Controllers/NotificationDeleteAllController.php:22)

in the controller there is this function:

dispatch_sync(function () {
    ...
})->afterResponse();

dispatch_sync has no afterResponse(), you probably should use the dispatch() as this has the afterResponse() method. See: https://laravel.com/docs/11.x/queues#dispatching-after-the-response-is-sent-to-browser

Detailed steps to reproduce the issue on a fresh Nova installation:

Trigger some notifications and click on the remove all button to delete the notifications

@crynobone crynobone added this to the 5.1.x milestone Jan 8, 2025
@crynobone crynobone added bug Verified bug by the Nova team fix incoming A fix is in review labels Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified bug by the Nova team fix incoming A fix is in review
Projects
None yet
Development

No branches or pull requests

2 participants