1 week ago

Having problem accessing data in a collection

Posted 1 week ago by Boubou

Hi all,

I am a real headache with this and cannot work it out.

Let's say you have an eloquent query like this one:

$users = User::select('id', 'email')

The result I get is this:

"email":"[email protected]",


I would like to access "post_json" per user, but whatever I try, I get stuck after this:

 foreach ($users as $user) {

I cannot access the post_id nor post_json

Any idea what am I doing wrong please?

Thank you.

Please sign in or create an account to participate in this conversation.