intervention/image
Intervention Image is a PHP image handling and manipulation library for Laravel and other frameworks. Create, resize, crop, encode, and optimize images with a simple fluent API, supporting GD and Imagick, plus drivers and integrations for common storage and HTTP workflows.
Image::make()->resize()->save()) mirrors Laravel’s Eloquent and Blade patterns, reducing cognitive load for developers.Constraints system (e.g., aspectRatio(), upsize()) enables declarative image processing, which is critical for responsive design and dynamic thumbnails. This aligns with modern frontend frameworks like Tailwind CSS or Next.js, where adaptive images are standard.storage_path(), public_path()), HTTP responses (toResponse()), and request handling ($request->file()) reduces boilerplate and tightens coupling to Laravel’s ecosystem.composer require and optional config publishing), making it a low-friction addition to any Laravel project. The package’s Laravel-specific features (e.g., Image facade) eliminate the need for manual service registration in most cases.AGENTS.md) ensure reliability. TPMs can leverage these for pre-integration validation.cache() method) to avoid reprocessing.toResponse()) be used for real-time delivery (e.g., API responses), or are pre-generated thumbnails sufficient?Image::make() provides a clean, global API.config/image.php).storage() and public_path() helpers.<img src="{{ $image->toBase64() }}">).toResponse() for direct HTTP delivery (e.g., return $image->toResponse('jpg');).dispatch(new ProcessImageJob($image))).Image::make()) for simplicity; avoid direct service container binding initially.->resize(300, 200)).try-catch wrapper for driver-specific errors (e.g., ImagickException).gd enabled in php.ini.imagick extension.vips extension.sudo apt-get install php8.3-gd php8.3-imagick).config/image.php (e.g., default driver, quality settings).php artisan vendor:publish --tag=config.Image::make($path)->resize()->save().->constraint(fn($c) => $c->aspectRatio())).->cache(fn($img) => $img->resize()).try-catch blocks for ImageException).How can I help you explore Laravel packages today?