Laravel UPCItemDB PackageLaravel
We have been working on an inventory system for one of our clients for a long time and recently, what we needed was to retrieve inventory item information by UPC code or ISBN or EAN. so the end customer does not need to fill a full form with all the details.
We implemented a feature where customers can just enter or scan UPC/ISBN/EAN code on the mobile app and we retrieve all the information of the product and auto-fill it with an image of the product as well.
So we started using UPCItemDB which has a very nice database of items. You can call their API and retrieve information about the product by sending UPC code. It has a free plan that you can use for trial purposes.
But there was no proper PHP or Laravel package for that, so we decided to make our own and publish it to Github.
laravel-upcitemdb and here is the link for it: https://github.com/InfyOmLabs/laravel-upcitemdb
Here are the installation steps and how to use this package.
Install the package by the following command,
composer require infyomlabs/laravel-upcitemdb
Publish the config file
Run the following command to publish config file,
php artisan vendor:publish --provider="InfyOm\UPCItemDB\UPCItemDBServiceProvider"
Add the Facade to your
'UPCItemDB' => \InfyOm\UPCItemDB\UPCItemDB::class,
For UPC Lookup, use the lookup method by calling,
For Search API, you can use the search method,
\UPCItemDB::search('iphone 6'); \UPCItemDB::search('iphone 6', ['brand' => 'apple']);