spatie/packagist-api
Search Packagist and fetch package details via the official Packagist API. Provides a simple PackagistClient built on Guzzle with a URL generator, plus helpers to list all packages or filter by vendor/type, and browse popular packages with pagination.
Http::macro for custom responses).guzzlehttp/guzzle (or Laravel’s built-in HTTP client), reducing bloat.try-catch blocks with custom exceptions.Spatie\PackagistApi\Packagist for fluent syntax.Http client to inject headers (e.g., Accept: application/vnd.pkg+json).php artisan package:audit).Spatie\PackagistApi\Packagist) with PSR-11 HTTP clients./api/packages/{name}) to avoid exposing Packagist’s API keys.composer/composer metadata).PackagistClientInterface)./p/{package}, /search.json).Spatie\PackagistApi for package search.composer.json.Accept header).PackageMetadataService).spatie/laravel-activitylog for failed requests)./api/packages/{name}/versions).spatie/packagist-api for updates (check Releases).guzzlehttp/guzzle and Laravel’s HTTP client if breaking changes occur.GuzzleHttp\Client).Log::debug($response->getBody())).dd() or dump() sparingly in production; prefer structured logging.php artisan queue:work --sleep=3 --tries=3).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Packagist API downtime | Missing package data | Local cache fallback + alerts |
| Rate limit exceeded | Throttled requests | Exponential backoff + caching |
| API response format change | Broken integrations | Feature flags + adapter pattern |
| Network latency | Slow package searches | Edge caching + async processing |
| Dependency version conflicts | Incompatible package versions | Semantic version validation in code |
Route::get('/package/{name}', [PackageController::class, 'show'])).php artisan package:info composer/composer).How can I help you explore Laravel packages today?