Tomas Turan Tomas Turan - 3 months ago 64
PHP Question

Laravel / Intervention Image Class - class not found

I just installed Intervention Image Class following instructions from here: http://image.intervention.io/getting_started/installation

I also added these 2 lines into config/app.php file:


'Intervention\Image\ImageServiceProvider'

'Image' => 'Intervention\Image\Facades\Image'


When I open my website, i get this error:

Class 'Intervention\Image\ImageServiceProvider' not found


Why is that and what should I do now?

Answer

Step 1:

Add this to the “require” section of your composer.json file.

"intervention/image": "dev-master"
as;
    "require": {
    "laravel/framework": "4.1.*",
        "intervention/image": "dev-master"
    },

Step 2:

Run CMD;
$ composer install

Step 3:

open the config/app.php file. Add this to the $providers array.

'Intervention\Image\ImageServiceProvider'

Step 4:

Next add this to the $aliases array.

'Image' => 'Intervention\Image\Facades\Image'

Step 5:

If there is an error;

Class 'Intervention\Image\ImageServiceProvider' not found

try

$ composer update
Comments