public function get_follower_request() { $follower = table_request_follow::where('json_request_follow', 'LIKE', '%2%')->get(); foreach ($follower as $fol) { $arrayid[$fol->users_id] = $fol->users_id; } echo "<pre>"; $follower = table_users_detail::whereIN('users_id', $arrayid)->get(); $dataConverted = array(); $app = app(); $i = 0; foreach ($follower as $row) { $dataConverted[$i] = $app->make('stdClass'); $dataConverted[$i]->id = $row->users_id; $dataConverted[$i]->unm = $row->users_name; $dataConverted[$i]->ufn = $row->users_fullname; $dataConverted[$i]->des = $row->users_description; $dataConverted[$i]->ava = $row->users_avatar; $i++; } print_r($dataConverted); die; //================ $app = app(); if (Request::has('token')) { $token = Request::input('token', ''); $compare = GlobalLibrary::tokenExtractor($token); $users_checker = GlobalLibrary::CheckUsersToken($compare); if ($users_checker[0]) { $uname = $users_checker[1]; $uid = $users_checker[2]; $email = $users_checker[3]; $followerrequest = table_request_follow::where('json_request_follow', 'LIKE', '%' . $uid . '%')->get(); foreach ($followerrequest as $fol) { $arrayid[$fol->users_id] = $fol->users_id; } //get users detail $follower = table_users_detail::whereIN('users_id', $arrayid)->get(); $dataConverted = array(); $app = app(); $i = 0; foreach ($follower as $row) { $dataConverted[$i] = $app->make('stdClass'); $dataConverted[$i]->id = $row->users_id; $dataConverted[$i]->unm = $row->users_name; $dataConverted[$i]->ufn = $row->users_fullname; $dataConverted[$i]->des = $row->users_description; $dataConverted[$i]->ava = $row->users_avatar; $i++; } //this code for convert $dataConverted = array(); $app = app(); $i = 0; foreach ($follower as $row) { $dataConverted[$i] = $app->make('stdClass'); $dataConverted[$i]->id = $row->users_id; $dataConverted[$i]->unm = $row->users_name; $dataConverted[$i]->ufn = $row->users_fullname; $dataConverted[$i]->des = $row->users_description; $dataConverted[$i]->ava = $row->users_avatar; $i++; } return (new Response(array('status' => true, 'msg' => 'success', 'data' => $dataConverted), 200))->header('Content-Type', "json"); } else { return (new Response(array('status' => false, 'msg' => 'Authentication Failed2'), 200))->header('Content-Type', "json"); } } else { return (new Response(array('status' => false, 'msg' => 'Authentication Failed1'), 200))->header('Content-Type', "json"); } }