I fetched data from table 'auction'
$players = DB::table('auction')->where('id',$id)->get();
I'm getting the data in this form
[
{
"id": 3,
"name": "Yogesh Singh",
"year": "BE",
"branch": "CE",
"division": "D",
"achievements": "College Cricket Team",
"base_price": 5000000,
"status": 1,
"manager": 0
}
]
now I need to shift this data into another table 'team', and hence I did
DB::table('team')->insert(['player_id' => $id, 'player_type' => $player->player_type, 'name' => $player->name, 'price' => $player->price]);
it throws an error saying, Property [player_type] does not exist on this collection instance.
I'm pretty sure i'm not able to convert the data fetched from DB to array.
How do I do this?