palmans / laravel-openfoodfacts
Open Food Facts API wrapper for Laravel
Installs: 61
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/palmans/laravel-openfoodfacts
Requires
- php: >=7.1
- guzzlehttp/guzzle: ^6.3
- illuminate/support: 5.7.x|5.8.x|6.*
- openfoodfacts/openfoodfacts-php: ^0.2.0
Requires (Dev)
- orchestra/testbench: 3.8.*|4.*
- phpunit/phpunit: ^7.0
README
This package provides a convenient wrapper to the Open Food Facts API for Laravel applications (5.7+).
Abandoned. Do not use this repo anymore
** MOVED TO OFFICIAL REPO **
>>> NEW LOCATION: openfoodfacts/openfoodfacts-laravel <<<
Archive:
Installation
You can install the package via composer:
composer require palmans/laravel-openfoodfacts
Usage
Find product details by barcode
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
...
)
Find products that match a search term:
$collection = OpenFoodFacts::find('Coca Cola Zero'); //returns a Illuminate\Support\Collection of arrays with details of each product found
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.