Laravel 5.3 电子邮件队列中不允许序列化“关闭"
问题描述
我愿意使用 queue
向电子邮件地址列表发送电子邮件.不使用队列我的代码工作正常,但使用队列它显示以下错误:
I am willing to send email to list of email address using queue
. Without using queue my code is working fine but with queue it's showing following error:
我正在使用 database
作为队列驱动程序.
I am using database
as queue driver.
以下是我的队列作业处理程序代码:
Following is my Queue job handler code:
和调度员代码:
我期待一个可行的解决方案.
I am expecting a feasible solution.
推荐答案
你不能序列化请求.只有 eloquent 模型可以序列化和反序列化.见这里:https://laravel.com/docs/5.2/queues#writing-工作类
You cannot serialize request. Only eloquent model can be serialized and unserialzed. See here: https://laravel.com/docs/5.2/queues#writing-job-classes
你应该使用 $request->all()
而不是 $request.由于 Request 被视为关闭.
You should use $request->all()
instead of $request. Since Request is treated as closure.
这篇关于Laravel 5.3 电子邮件队列中不允许序列化“关闭"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!