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