Reputation:
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
Reputation: 29
Copy file config.php in folder /vender/intervention/image/src/config/config.php to /config/
and rename config.php to image.php
Update config
php artisan config:cache
Upvotes: 2
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