Webplaats's avatar

What kind of magic is $user['id' ]

Example:

$user = \App\User::find(1);
echo $user->id; // 1
echo $user['id']; // 1

I did not know the array-like syntax. Is there some documentation on this? How is this magic called?

0 likes
2 replies
Webplaats's avatar

Thank you Yorki, this is what I was looking for!

Please or to participate in this conversation.