Share this
The error “Class ‘Intervention\Image\ImageServiceProvider’ not found” in Laravel usually occurs when the Intervention Image package is not properly installed or configured.
Steps to Fix:
1. Install Intervention Image Package
Run the following command to install the package via Composer:
composer require intervention/image
2. Check config/app.php
(For Laravel <= 5.4)
If you’re using Laravel 5.4 or earlier, manually add the service provider and alias in config/app.php
:
-
Service Provider:
-
'providers' => [ Intervention\Image\ImageServiceProvider::class, ],
- Alias:
-
'aliases' => [ 'Image' => Intervention\Image\Facades\Image::class, ],
For Laravel 5.5+ (including Laravel 9 and 10), you don’t need to manually add the provider, as it is auto-discovered.
3. Clear Config and Cache
After installation, clear the configuration cache:
php artisan config:clear php artisan cache:clear
4. Publish Configuration (Optional)
You can publish the configuration file to config/image.php
:
php artisan vendor:publish --provider="Intervention\Image\ImageServiceProvider"
5. Dump Autoload and Restart Server
Run:
composer dump-autoload php artisan serve
6. Verify Installation
Try running this inside a Laravel route or controller:
</p> use Intervention\Image\Facades\Image; $image = Image::make(public_path('example.jpg'))->resize(300, 200); return $image->response('jpg'); <p data-start="1364" data-end="1418">

Ravindra is a passionate full stack developer and dedicated blogger with a flair for crafting user-friendly web applications and insightful articles. With expertise spanning front-end and back-end technologies, Ravindra brings ideas to life through innovative coding solutions.