I'm having a data set which is coming through request in my Laravel 6
application, I want to convert this to collection but it is not working out:
$request_status = json_decode($request->status);
$data = collect($request_status)->pluck('id');
dd($data);
This is giving me output of null
;
When I do dd($request->status)
:
"[{"id":3,"type":"Awarded","name":"Awarded"}]"
No change happens in the data, if I do dd($data)
I get:
Collection {#791 ▼
#items: array:1 [▼
0 => null
]
}
I tried doing json_decode($request->status, true)
but no luck.