shortpixel/shortpixel-php
Official PHP SDK for ShortPixel image optimization. Compress JPEG, PNG, GIF, WebP, AVIF and PDF files via the ShortPixel API using lossy, glossy or lossless modes, with bulk processing, CDN delivery and framework-agnostic support for any PHP app, including Laravel.
Architecture fit
ImageOptimizer interface with a ShortPixelOptimizer adapter), so controllers, jobs, and spatie/laravel-medialibrary conversions depend on our contract rather than on ShortPixel\* classes.Integration feasibility
composer require shortpixel/shortpixel-php, cURL only, MIT license), so there is no procurement or licensing blocker.setOptions-type entry point plus fromFiles/fromUrls/fromFolder helpers) and calls cURL directly. That makes it awkward to inject and hard to fake in tests; expect to wrap it and stub at our interface boundary, or accept integration tests against the live API in a sandbox account.Technical risk
Key questions
ext-curl sufficient, or are there Imagick dependencies?Stack fit
config/shortpixel.php (key from secrets manager, endpoint region, default compression level, per-disk policy) → ShortPixelOptimizer adapter implementing an ImageOptimizer contract → OptimizeImageJob on a dedicated queue → downloaded output written through Laravel's Storage facade to our S3/local disk → optimizations table records source hash, provider job ref, savings, credits spent.Migration path
dry-run flag that logs would-be spend without calling the API.Compatibility
intervention/image or spatie/laravel-medialibrary — it slots in as a post-processing conversion. Do not let it replace local conversions entirely; keep a local path so a vendor outage cannot block uploads."x.y.z") rather than a caret range; a solo-maintained client with static configuration can change signatures in minor releases.Sequencing
Maintenance
Support
Scaling
maxProcesses / RateLimiter) to stay inside vendor limits and to prevent a backfill from starving user-facing jobs.Failure modes
Ramp-up
How can I help you explore Laravel packages today?