public function getUser(Request $request) { if ($request->input('user') == 'passenger') { return Passenger::getPassenger($request->contactNo); } elseif ($request->input('user') == 'driver') { return Driver::getDriver($request->input('contactNo')); } }