Hey Folks, I'm gettng "Object of class stdClass could not be converted to string" while fetching records from DB.
Scenario
I have table called "TripData" where i have stored all the information of trip that user has planned (including userID,Trip Date, trip country , lat , long etc). Now I'm working on a feature where user can see nearby people. For that I'm allowing a user to select his planed city and see nearby user.
Now coming to the problem:
I want to pass the country name to DB Query to get all the user with same country. For that i have written following query:
// This is working fine returning the country name that i have seleced
$trip_country = DB::table('trip_data')->where('id',$request->people_near_by)->get(['trip_country']);
// Based on above country i want to fetch all the user having same country for that i have written the below query
$all_trip = DB::table('trip_data')->where('trip_country', '=' , $trip_country)->get();
But when i execute it i get above mentioned error. Any leads or suggestion will be highly appreciated.