diff --git a/app/Services/OpenAIService.php b/app/Services/OpenAIService.php index f344ae11..2cb33173 100644 --- a/app/Services/OpenAIService.php +++ b/app/Services/OpenAIService.php @@ -70,7 +70,7 @@ public function importRulesForAllCities(bool $force): void $cityData = [ "cityId" => $city->id, "countryId" => $city->country_id, - "city_name" => $city->name, + "cityName" => $city->name, "countryName" => $city->country->name, ]; $jobs[] = new ImportCityRulesJob($cityData, $force); @@ -101,7 +101,7 @@ public function importRulesForCity(array $cityData, bool $force): array $prompt_en = "Act as a helpful assistant. Explain what are the legal limitations for riding electric scooters in $cityName, $countryName? Contain information about: max speed, helmet requirements, allowed ABV, passengers, other relevant details. Be formal, speak English. Don't include city name in your response. If you don't have information answering the question, write 'null'."; $prompt_pl = "Translate to polish: "; - $currentRulesInCountry = Rules::query()->where("countryId", $countryId)->first(); + $currentRulesInCountry = Rules::query()->where("country_id", $countryId)->first(); if (in_array($countryName, $this->countriesKnownToHaveUniformRules, true) && $currentRulesInCountry !== null && $currentRulesInCountry->rules_en !== null && $currentRulesInCountry->rules_pl !== null && !$force) { $rules_en = $currentRulesInCountry->rules_en;