Skip to content
Advertisement

Laravel error while sending a queue email

I’m facing the following error in the failed_jobs database table:

ErrorException: Undefined property: stdClass::$subscription in /home/sm/public_html/app/Mail/NewCustomer.php:45

This is pretty basic. It means the property $subscription does not exists, but…the problem is that I don’t call $subscription anywhere in the class code.

In the controller I assign the values:

JavaScript

And the NewCustomer class contains:

JavaScript

The view mails/new_customer also does not contain anything related with $subscription.

Is this some cache problem or something? I can’t figure out where the variable $subscription comes from.

If instead of Queue I send the email immediately, it works great:

JavaScript

Advertisement

Answer

Solved.

It was indeed a cache problem. Run php artisan queue:restart in terminal or through laravel:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement