calliostro/php-discogs-api
Lightweight Discogs API client for PHP 8.1+ with clean, modern APIs and Guzzle support. Access public artist/release/label data without registration, and enable search plus user features with consumer credentials. Includes optional Symfony Bundle integration.
getArtist, createMarketplaceListing) improve readability and reduce cognitive load.DiscogsClient as a singleton with typed dependencies:
$this->app->singleton(DiscogsClient::class, fn() =>
(new DiscogsClientFactory())->create(config('services.discogs'))
);
DiscogsMarketplaceSyncJob) benefit from type-safe payloads.Release → Album)..env).| Risk Area | Mitigation Strategy |
|---|---|
| Breaking Changes | Use UPGRADE.md guide to automate method renaming (e.g., regex search/replace). |
| OAuth 1.0a Complexity | Leverage Laravel’s OAuth1 facade or wrap DiscogsClient in a service layer. |
| Type Safety Overhead | Minimal; IDE autocomplete offsets validation effort. |
| Discogs API Drift | Monitor Discogs API docs; use feature flags for deprecated endpoints. |
| Testing | Mock DiscogsClient with PHPUnit’s createMock() or Guzzle’s HandlerStack. |
findArtistReleases → listArtistReleases) or a custom script?OAuth1 facade, or will you implement a custom DiscogsAuthService?null vs. never)?DiscogsClient and DiscogsClientFactory.OAuth1 facade or use ramsey/oauth1 for fine-grained control.DiscogsReleaseFetcher) benefit from typed payloads.createMock(DiscogsClient::class) for unit tests.composer.json to v4.0.0 and run composer update.UPGRADE.md for method renaming patterns.findArtistReleases → listArtistReleases).$client = (new DiscogsClientFactory())->create([
'consumer_key' => config('services.discogs.key'),
'consumer_secret' => config('services.discogs.secret'),
'token' => config('services.discogs.token'),
'token_secret' => config('services.discogs.token_secret'),
]);
.env.| Priority | Task | Dependencies |
|---|---|---|
| 1 | Update composer.json and run composer update. |
None |
| 2 | Refactor all method calls using UPGRADE.md guide. |
Package v4.0.0 installed |
| 3 | Update authentication to OAuth 1.0a. | Method refactoring complete |
| 4 | Bind DiscogsClient to Laravel’s service container. |
Authentication configured |
| 5 | Write integration tests for critical endpoints. | Service container bound |
| 6 | Implement caching (e.g., Redis) for frequent queries. | All prior steps |
| 7 | Deploy to staging and monitor for OAuth/rate-limit issues. | Integration tests passed |
calliostro/php-discogs-api for breaking changes (now semver-compliant).composer why-not-update to track Guzzle/PSR-18 updates.OAuth1 facade or a custom DiscogsTokenManager.DiscogsClient errors (e.g., OAuth failures).consumer_key, token, and secrets in .env.DiscogsException).DiscogsClient supports Laravel queue workers.discogs:fetch-* jobs independently.getArtist, listReleases (e.g., Redis TTL).chunk() for large Discogs datasets.| Failure Scenario | Mitigation Strategy |
|---|---|
| OAuth Token Expiry | Implement token rotation with Laravel’s OAuth1 or a cron job. |
| Rate Limit Exceeded (429) | Use Guzzle’s retry_middleware with exponential backoff. |
| Discogs API Downtime | Fallback to local cache (Redis) or static data. |
| Method Call Errors | Type hints catch issues early; use IDE autocomplete to avoid typos. |
| Schema Changes | Use migrations for |
How can I help you explore Laravel packages today?