Support the ongoing development of Laravel.io →
Requests Input

Hello,

I am using laravel-push-notification library to push data towards android devices, it works great!

However, I want to handle the response, so here is my code:

foreach ($collection->pushManager as $push) {
  $response = $push->getAdapter()->getResponse();
  dd($response);
}

This works, I got this:

Response {#202#id: 6874005614076
  #cntSuccess: 0
  #cntFailure: 1
  #cntCanonical: 0
  #message: Message {#196 ▶}
  #results: array:1 [▶]
  #response: array:5 [▶]
}

So now let's say I want to display the id, I tried this: dd($response->id); I got this error: Cannot access protected property ZendService\Google\Gcm\Response::$id

I tried to access it as an array: dd($response['id']); And I got this: Cannot use object of type ZendService\Google\Gcm\Response as array

So, how to access this data?

Thanks

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

dropit4585 dropit4585 Joined 16 May 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.