This package provides a convenient wrapper to the Open Food Facts API for Laravel applications.
You can install the package via composer:
composer require openfoodfacts/openfoodfacts-laravel
composer require "openfoodfacts/openfoodfacts-laravel:^0.3"
composer require "openfoodfacts/openfoodfacts-laravel:^0.2"
OpenFoodFacts::barcode('20203467');
it returns an array with product details:
Array
(
[product_name] => Cantuccini with hazelnuts
[image_url] => https://static.openfoodfacts.org/images/products/20203467/front_fr.4.400.jpg
...
)
$collection = OpenFoodFacts::find('Coca Cola Zero');
// returns a Illuminate\Support\Collection of arrays with details of each product found
You're very welcome to contribute. We coordinate on the Open Food Facts slack, on the #PHP channel : https://slack.openfoodfacts.org Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.
If you use this SDK, feel free to open a PR to add your application in this list.