spatie / laravel-slack-alerts

Quickly send a message to Slack
https://freek.dev/2172-a-package-to-quickly-send-slack-alerts-in-a-laravel-app
MIT License
289 stars 33 forks source link

"The script tried to call a method on an incomplete object" #8

Closed MrMooky closed 2 years ago

MrMooky commented 2 years ago

When calling SlackAlert::message("New signup on FeatureShift: {$user->email} :tada:"); I get the following error:

[2022-02-19 15:29:33] production.ERROR: The script tried to call a method on an incomplete object. Please ensure that the class definition "Spatie\SlackAlerts\Jobs\SendToSlackChannelJob" of the object you are trying to operate on was loaded before unserialize() gets called or provide an autoloader to load the class definition {"exception":"[object] (Error(code: 0): The script tried to call a method on an incomplete object. Please ensure that the class definition \"Spatie\SlackAlerts\Jobs\SendToSlackChannelJob\" of the object you are trying to operate on was loaded before unserialize() gets called or provide an autoloader to load the class definition at /home/xxxxx/webapps/xxxxx/releases/20220219141754/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php:295)

Am I missing something? Setup seemed pretty straightforward.

MrMooky commented 2 years ago

Was an issue on my end.

fdabek1 commented 2 years ago

Was an issue on my end.

What was the issue?!? I'm having the same issue and can't figure out what I'm missing.

Edit: For future people that this may help, I had to restart my queue since it didn't have the latest PHP code loaded in.