Laravel Intervention Image Class - Class 'Image' not found

I try to install intervention/imagefrom the composer, but after installation I get this error:

Class 'Image' not found

1: install through composer:

composer require intervention/image 

2: add to the array of providers:

'Intervention\Image\ImageServiceProvider' 

3: add to the array of aliases:

'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
+4
source share
2 answers
  • Copy the config.php file to the /vender/intervention/image/src/config/config.php folder in / config /
    and rename config.php to the image.php file

  • Update configuration

    php artisan config: cache

+2
source

Image ,

// import class
use Image;

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

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

Source: https://habr.com/ru/post/1617953/


All Articles