static function getUserList() { $userList = User::all()->toArray(); //echo '<pre>'; print_r($userList); echo '</pre>'; exit; //dd(User::all()); foreach ($userList as $key => $user) { //echo $key; //echo '<pre>'; print_r($user); echo '</pre>'; //exit; $scanEnds = Scan::getScanEnds($user['id']); //echo '<pre>'; print_r($scanEnds); echo '</pre>'; exit; $userList[$key]['last_scan'] = $scanEnds[0]->last_scan; $userList[$key]['first_scan'] = $scanEnds[0]->first_scan; } return $userList; }