jeudi 12 décembre 2019

How to access unserialise Laravel Queue data?

I need to get the value of projectId from the queue payload. When I try with the following

Queue::after(function (JobProcessed $event) {
      $payload = json_decode( $event->job->getRawBody() );
      $data = unserialize( $payload->data->command );
      \Log::info((array) $data );
  });

I get the following output:

[2019-12-12 11:34:35] local.INFO: array (
 '' . "\0" . '*' . "\0" . 'projectId' => '1',
 '' . "\0" . '*' . "\0" . 'job' => NULL,
'connection' => NULL,
'queue' => NULL,
'chainConnection' => NULL,
'chainQueue' => NULL,
'delay' => NULL,
'chained' => 
array (
    ),
 )  

How can I get the value of "projectId?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire