Intervention Image Laravel

Laravel integration for Intervention Image with a service provider, facade, and config.

Library
Composer
v4.1.1
159stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
62/100Good
Development Activity60
Maintenance60
Community52
Maturity48
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
77/100Good
Architecture78
Code Quality80
Innovation60
Learning Curve88

Intervention Image Laravel is the official Laravel integration package for Intervention Image, the popular PHP image-handling library. It wires the image manager into Laravel’s service container, ships an Image facade, and provides a publishable configuration file so you can set your driver and options once for the whole application.

Rather than instantiating and configuring the image manager on every call, this package lets you configure Intervention Image centrally and resolve it through Laravel’s dependency injection or facade. It also adds an HTTP response helper for returning encoded images directly from controllers.

What You Get

  • A Laravel service provider that binds a preconfigured Intervention Image manager into the container
  • An Image facade for fluent, application-wide access to image operations
  • A publishable config/intervention-image.php file for central driver and option configuration
  • An HTTP response factory for returning encoded images straight from controllers
  • Auto-discovery of the provider and facade alias via Laravel’s package discovery

Common Use Cases

  • Resizing and cropping uploaded images in a Laravel application
  • Applying watermarks or format conversions to user media
  • Serving dynamically encoded images as HTTP responses
  • Centralizing image driver configuration across a Laravel project

Under The Hood

Architecture - The package is deliberately thin. src/ServiceProvider.php reads the merged config/intervention-image.php, constructs an ImageManager with the chosen driver, and binds it into Laravel’s container while registering the publishable config. src/Facades/Image.php exposes that binding as a facade, and src/ImageResponseFactory.php turns an encoded image into an HTTP response. Provider and alias are auto-registered through the extra.laravel block in composer.json.

Tech Stack - Pure PHP requiring PHP 8.3+, built on intervention/image ^4.0 and the illuminate/support, illuminate/http, and illuminate/routing components (Laravel 8 through 13). PSR-4 autoloaded under Intervention\Image\Laravel\.

Code Quality - Despite its small size the repo is well-tooled: a tests/ suite runs against Orchestra Testbench across multiple PHPUnit and Laravel versions, with a Dockerized CI setup. The code is focused and idiomatic Laravel.

API Design - Integration follows familiar Laravel conventions: install, optionally publish the config, then call Image::read(...) via the facade or inject the manager. There is almost no learning curve for anyone who knows both Laravel and Intervention Image.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search