beyondcode / helo-laravel

HELO Laravel helper package to add
MIT License
87 stars 26 forks source link

Queued Mailables – Serialization of 'Closure' is not allowed #5

Closed heikokrebs closed 3 years ago

heikokrebs commented 4 years ago

When i use this package and try to queue a Mailable that implements ShouldQueue i get an Exception:

  Serialization of 'Closure' is not allowed

  at vendor/laravel/framework/src/Illuminate/Queue/Queue.php:147
    143| 
    144|         return array_merge($payload, [
    145|             'data' => [
    146|                 'commandName' => get_class($job),
    147|                 'command' => serialize(clone $job),
    148|             ],
    149|         ]);
    150|     }
    151| 

Laravel version: 7.6.2 Laravel config cached: false PHP version: 7.4.4

romualdbrsn commented 4 years ago

Same issue here... PHP Version 7.3. Thanks !

joseaneto commented 4 years ago

Same here with PHP 7.4

pryley commented 4 years ago

See also https://github.com/statamic/cms/issues/2262

dniccum commented 3 years ago

+1

KevinBatdorf commented 3 years ago

Came here to report the same. Using Statamic too (the test email utility)

dorqa95 commented 3 years ago

Unfortunately is the same in laravel 8.36.0 and php 7.3.0 with queue.

This helped: https://github.com/beyondcode/helo-laravel/pull/12/commits/086ed2edcebf67bb45e88d9ddcd5ad20ea827c33

eugenefvdm commented 3 years ago

I've stopped using HELO due to this problem.

mpociot commented 3 years ago

This is now fixed. And just as an FYI: you can use HELO without adding this helper package as well. You only loose some of the Laravel specific debug information - but the local mails are still going to work, as HELO is not Laravel specific.