Intervention Image facade or class not found after upgrading
The Image facade stops working after a composer updateShort answer
Intervention Image 3 removed the Laravel service provider and the old facade from the core package. Install intervention/image-laravel, import Intervention\Image\Laravel\Facades\Image, publish config/image.php, and call read() instead of make(). Without the extra package, the old class name does not exist.
Fix it fast
1Find out which cause you have
See which major version is installed and whether the Laravel integration package is there.
composer show intervention/image composer show intervention/image-laravel2Match what you see, then jump to its fix
- 1
composer show intervention/image-laravel says the package is not found.The Laravel integration package is not installedFix - 2
The error names Intervention\Image\Facades\Image, or you copied an old tutorial.The code still imports the version 2 facade namespaceFix - 3
The config file still holds a plain string such as 'gd' or 'imagick' for the driver.A string driver name is left in the configurationFix
- 1
What does the error look like?
The Image facade stops working after a composer updateClass "Intervention\Image\Facades\Image" not found
Cause 1 of 3
The Laravel integration package is not installed
1Check
Since version 3 the Laravel code is a separate package. The core package alone has no Laravel facade.
composer show intervention/image-laravel2Fix
Install the package, then publish its config file.
composer require intervention/image-laravel
php artisan vendor:publish --provider="Intervention\Image\Laravel\ServiceProvider"3Verify
The file config/image.php exists.
ls config/image.phpConfirmed by image.intervention.io
Cause 2 of 3
The code still imports the version 2 facade namespace
1Check
The v2 facade lived in Intervention\Image\Facades. In v3 the Laravel facade is in Intervention\Image\Laravel\Facades, and the upgrade guide says the old Laravel service providers were removed.
grep -rn "Intervention\\\\Image" app config routes | head2Fix
Change the import, and use read() where the old code used make().
use Intervention\Image\Laravel\Facades\Image;
$image = Image::read($request->file('image'))->resize(300, 200);3Verify
Run the route that processes an image.
php artisan route:listConfirmed by image.intervention.io
Cause 3 of 3
A string driver name is left in the configuration
1Check
Version 2 chose the driver with a string. Version 3 expects the driver class name.
grep -rn "driver" config/image.php2Fix
Use the driver class, or create the manager yourself without the facade.
use Intervention\Image\ImageManager;
use Intervention\Image\Drivers\Gd\Driver;
$manager = new ImageManager(new Driver());
$image = $manager->read('images/example.jpg');3Verify
Read one real file with the manager and resize it; no exception means the driver loads.
php -m | grep -i -E "gd|imagick"Confirmed by image.intervention.io
How do I stop it coming back?
- Pin the major version in composer.json (intervention/image:^3) so an update cannot change the API.
- Read the upgrade guide before moving a major version of an image library.
- Check that GD or Imagick is enabled with php -m, because the library needs one of them.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Back end
Composer says the gd extension is missing on a Laravel project
composer install or composer update stops on a package that requires ext-gd
Composer refuses to install a package that requires ext-gd when the PHP binary running Composer has no GD extension.
4 causes, each with a fixBack end
composer require maatwebsite/excel fails to install
Composer says the package needs an older PHP than the one installed
Composer refuses maatwebsite/excel when the PHP version or a PHP extension does not match what the package and PhpSpreadsheet need.
3 causes, each with a fixBack end
composer install says the lock file is not compatible and asks for update
Your lock file does not contain a compatible set of packages. Please run composer update.
composer install checked the locked packages against this machine's PHP and extensions and found a conflict.
3 causes, each with a fixBack end
composer require laravel/horizon fails: ext-pcntl is missing
laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system
Horizon needs the pcntl extension, and Composer refuses to install it where PHP lacks that extension.
3 causes, each with a fixBack end
composer require laravel/passport stops with 'requirements could not be resolved'
... but these were not loaded, likely because it conflicts with another require.
Composer found no Passport release that fits your project at once.
4 causes, each with a fixBack end
Composer says the root composer.json requires a PHP version your PHP does not satisfy
Your requirements could not be resolved to an installable set of packages.
Composer compares the php constraint in your composer.json, or in a package, with the PHP that runs Composer.
3 causes, each with a fix