'staff_1', 'requestData' => [] ]; } public function handler() { $user = Controller::getLoggedUser(); $userId = Controller::request('staffId'); $userRow = Staff::getDataStore($userId); if($user->level == 3 && !$userRow->isNull()) { $user = $userRow; } $parsedDepartmentList = []; $departmentList = $user->sharedDepartmentList; foreach($departmentList as $department) { $parsedDepartmentList[] = [ 'id' => $department->id, 'name' => $department->name ]; } Response::respondSuccess([ 'name' => $user->name, 'email' => $user->email, 'profilePic' => $user->profilePic, 'level' => $user->level, 'staff' => true, 'departments' => $parsedDepartmentList, 'tickets' => $user->sharedTicketList->toArray() ]); } }