user4790312
user4790312

Reputation:

Laravel Intervention Image Class - Class 'Image' not found

I'm trying to install intervention/image from composer, but after installation I get this error:

Class 'Image' not found

1: install via composer:

composer require intervention/image 

2: add to providers array:

'Intervention\Image\ImageServiceProvider' 

3: add to aliases array:

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

4: update composer:

composer update

5: publish:

php artisan vendor:publish --provider="Intervention\Image\ImageServiceProviderLaravel5" 

public result:

Nothing to publish for tag [].

6: autoload:

composer dump-autoload

Upvotes: 4

Views: 10609

Answers (2)

Parkorn Soonthornchai
Parkorn Soonthornchai

Reputation: 29

  1. Copy file config.php in folder /vender/intervention/image/src/config/config.php to /config/
    and rename config.php to image.php

  2. Update config

    php artisan config:cache

Upvotes: 2

pespantelis
pespantelis

Reputation: 15382

If you use the Image facade into a namespaced class, you should try this

// import class
use Image;

// then
Image::make('public/foo.jpg');

or

\Image::make('public/foo.jpg');

Upvotes: 1

Related Questions