Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

davy_yg's avatar

Class "Intervention\Image\ImageServiceProvider" not found

I got the following error when running laravel. Any clue why?

In ProviderRepository.php line 206:

Class "Intervention\Image\ImageServiceProvider" not found

0 likes
2 replies
LaryAI's avatar
Level 58

This error usually means that the Intervention Image package is either not installed or not properly autoloaded in your Laravel project.

Here's how to resolve it:

  1. Install the Intervention Image package via Composer:
composer require intervention/image
  1. (For Laravel 5.x and below) Register the Service Provider and Facade:

If you are using Laravel 6 or above, Laravel uses package auto-discovery, so you don't need to manually add the service provider or facade.
If you are using Laravel 5.x or below, add the following to your config/app.php:

In the providers array:

Intervention\Image\ImageServiceProvider::class,

In the aliases array:

'Image' => Intervention\Image\Facades\Image::class,
  1. Clear and cache your config:
php artisan config:clear
php artisan cache:clear
composer dump-autoload
  1. Check your code for typos:

Make sure you are referencing the correct class name:
Intervention\Image\ImageServiceProvider


Summary:
The error occurs because Laravel can't find the Intervention\Image\ImageServiceProvider class. Installing the package with Composer should resolve the issue.

If you still encounter the error after following these steps, please ensure your composer.json and vendor directory are up to date, and that there are no typos in your service provider registration.

Snapey's avatar

because you need to instantiate the manager and not the class itself.

Larys answer is about 7years out of date

use Intervention\Image\ImageManager;
use Intervention\Image\Drivers\Imagick\Driver;

// create new manager instance with desired driver
$manager = new ImageManager(new Driver());

Please or to participate in this conversation.