0
如何反序列化失败作业的有效载荷? 这里是我的情况:Laravel 5.4反序列化有效载荷
我想保留失败作业的跟踪,并通知用户...对于我用这个片段:
Queue::failing(function (JobFailed $event) {
// $event->connectionName
// $event->job
// $event->exception
LoggerFacade::addAlert("Error".$event->job->getRawBody());
});
作品不错,但我无法获取我的元数据,就像feed ID一样。
序列化的数据看起来是这样的:
$json = '{"displayName":"Illuminate\\Foundation\\Console\\QueuedCommand","job":"Illuminate\\Queue\\[email protected]","maxTries":null,"timeout":null,"data":{"commandName":"Illuminate\\Foundation\\Console\\QueuedCommand","command":"O:43:\"Illuminate\\Foundation\\Console\\QueuedCommand\":1:{s:7:\"\u0000*\u0000data\";a:2:{i:0;s:11:\"import:feed\";i:1;a:1:{s:7:\"feed_id\";s:1:\"4\";}}}"}}';
我需要这部分
import:feed\";i:1;a:1:{s:7:\"feed_id\";s:1:\"4\";}}}
这dd(unserialize($json));
不起作用。
不工作,返回false – erwinnandpersad
什么是解码后'$ json'的价值? – Aboudeh87