Download the PHP package tonylabs/laravel-digikey without Composer
On this page you can find all versions of the php package tonylabs/laravel-digikey. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tonylabs/laravel-digikey
More information about tonylabs/laravel-digikey
Files in tonylabs/laravel-digikey
Package laravel-digikey
Short Description Laravel package for DigiKey Product Information API V4 with OAuth2 authentication
License MIT
Homepage https://github.com/tonylabs/laravel-digikey
Informations about the package laravel-digikey
Laravel DigiKey API Package
A Laravel package for integrating with the DigiKey Product Information API V4. This package provides OAuth2 authentication and comprehensive access to DigiKey's product search and information APIs.
Requirements
- PHP 8.1 or higher
- Laravel 10.0 or higher (optimized for Laravel 11+)
- GuzzleHTTP 7.0+
Installation
Install the package via Composer:
Publish the configuration file:
Configuration
Add your DigiKey API credentials to your .env file:
Usage
Quick Start
setOrder() accepts either the SortField/SortOrder enums shown above or plain strings (e.g. 'QuantityAvailable', 'descending').
Calling new DigiKey() reads DIGIKEY_CLIENT_ID and DIGIKEY_CLIENT_SECRET from your configuration. You can override them explicitly:
The fluent helpers work alongside array payloads or KeywordSearchRequest instances:
To remove previously configured helpers, call resetFilters(). Use resetPagination() to clear any fluent limit or offset. The client
validates and refreshes OAuth tokens automatically through the existing
validateToken() flow.
Locale overrides may be cleared with resetLocale() which reverts to the configuration defaults.
If you would rather control credentials directly, instantiate
new DigiKey(client_id: '...', client_secret: '...') and use the instance.
Basic Usage with Facade
OAuth2 Authentication
The package automatically handles OAuth2 authentication using client credentials flow. Tokens are automatically obtained and cached when needed.
API Methods
searchKeyword(string|array|KeywordSearchRequest $search, array $options = [])- Search for products using keywordsgetProductDetails(string $productNumber)- Get detailed product informationgetManufacturers()- Get list of manufacturersgetCategories()- Get list of categoriesgetProductPricing(string $productNumber, int $quantity)- Get product pricinggetRecommendedProducts(string $productNumber)- Get recommended products- And many more...
License
This package is open-sourced software licensed under the MIT license.
All versions of laravel-digikey with dependencies
illuminate/support Version >=9.0
illuminate/http Version >=9.0
guzzlehttp/guzzle Version ^7.8
spatie/laravel-package-tools Version ^1.92