how get just one parameter of all objects in one array in laravel

Solutions on MaxInterview for how get just one parameter of all objects in one array in laravel by the best coders in the world

showing results for - "how get just one parameter of all objects in one array in laravel"
Juan Manuel
21 Apr 2017
1$patients_id = FollowUpQuestionsAfterSurgery::
2orderBy('id' , 'desc')
3->pluck("patient_id");
4
5$patients = Paitent::whereIn("id" , $patients_id)->get()->->toArray();
6
7
8return array_column($patients , "follow_up");
9