I got a data structure like below that is created by laravel collection put() function.
Code:
$array= collect();
$array->put($id, "1");
$array->put($name, "test");
Result:
{
"id": "1",
"name": "test"
}
How can I get the value with this syntax $array->id
instead of this $array['id']
?