Skip to content
Open Food Facts API wrapper for Laravel
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
src
tests
.editorconfig
.gitattributes
.gitignore
.phpunit.result.cache
.scrutinizer.yml
.styleci.yml
.travis.yml
CONTRIBUTING.md
LICENSE.md
README.md
composer.json
phpunit.xml.dist

README.md

Laravel Open Food Facts API

Latest Version on Packagist Build Status Code Coverage Quality Score

This package provides a convenient wrapper to the Open Food Facts API for Laravel applications (5.7+).

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.

You can’t perform that action at this time.