Closed n-va closed 6 months ago
we are open to PR's ofcourse, but alternatively, you could try to change the geography config setting at runtime before calling the OpenFoodFacts class (or through its facade), e.g.
Config::set('openfoodfacts.geography', 'fr');
$openfoodfacts = app(OpenFoodFacts::class);
// $openfoodfacts->barcode('20203467');
(note: untested code)
available now (^0.4.1)
See https://github.com/openfoodfacts/openfoodfacts-laravel/pull/22
The geographic subdomain is assigned via the config:
This doesn't allow for the API subdomain to be conditionally changed if the user is in another country. It would be great if this value could be assigned when the class instantiated.