login( (string) $request->validated('site_code'), (string) $request->validated('username'), (string) $request->validated('password'), ); } catch (PlayerAuthenticationException $e) { return ApiResponse::error( $e->getMessage(), $e->lotteryCode, null, $e->httpStatus, ); } return ApiResponse::success($data); } }