mathiasgrimm/glimpse-php
| Install | |
|---|---|
composer require mathiasgrimm/glimpse-php |
|
| Latest Version: | v3.3.2 |
| PHP: | ^8.2 |
| Laravel: | 10 – 13 |
| License: | MIT |
| Last Updated: | Sep 12, 2026 |
| Links: | GitHub · Packagist |
Shipping images means wrangling ImageMagick, libvips, mozjpeg, cwebp and avifenc: compiled binaries that differ between your laptop, your teammate's laptop, and production. glimpse-php replaces all of them with one method call, with zero binary dependencies. The heavy lifting happens on the Glimpse API: stateless, nothing stored, your bytes never linger. You require a single package and go:
composer require mathiasgrimm/glimpse-php
use MathiasGrimm\GlimpsePhp\Glimpse;
$glimpse = Glimpse::createClient('YOUR_TOKEN');
$result = $glimpse->optimize(file_get_contents('photo.jpg'));
file_put_contents('photo-optimized.jpg', $result->bytes);
That is the whole integration: no extensions to compile, no binaries to pin, no queue of shell-outs to babysit. Every method returns typed, immutable results.
Documentation
The full documentation lives at glimpseimg.com/docs/sdk:
- Installation: requirements and optional extensions.
- Authentication: building the client and verifying tokens.
- Methods: every method and the typed objects it returns.
- Laravel: container wiring and
Http::fake()in tests. - Errors: the exception hierarchy.
Upgrading from v1? The upgrade guide covers the move from array returns to typed objects.
Development
composer install
composer test # Pint (check), PHPStan, and the Pest suite
Releasing
make release VERSION=vX.Y.Z
Runs the test suite, tags VERSION, pushes the tag, and creates the GitHub release. Packagist picks the new tag up through the GitHub webhook.
License
glimpse-php is open-source software licensed under the MIT license.
Related Packages
Convert, optimize, resize, thumbnail and analyze images from your terminal. The...
Aspose.PDF Cloud is a REST API for creating and editing PDF files. It can also b...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v3.3.2 | ^8.2 | ^10.0| | MIT | |
| v3.3.1 | ^8.2 | ^10.0| | MIT | |
| v3.3.0 | ^8.2 | ^10.0| | MIT | |
| v3.2.0 | ^8.2 | ^10.0| | MIT | |
| v3.1.0 | ^8.2 | ^10.0| | MIT | |
| v3.0.0 | ^8.2 | ^10.0| | MIT | |
| v2.0.1 | ^8.2 | ^10.0| | MIT | |
| v2.0.0 | ^8.2 | ^10.0| | MIT | |
| v1.0.1 | ^8.2 | ^10.0| | MIT | |
| v1.0.0 | ^8.2 | ^10.0| | MIT | |
| v0.2.0 | ^8.2 | ^10.0| | MIT | |
| v0.1.0 | ^8.2 | ^10.0| | MIT |