spatie / laravel-glide

Easily convert images with Glide
https://freek.dev/2015/12/easily-convert-images-with-glide/
MIT License
424 stars 51 forks source link

Call to undefined method GlideImage::create() #49

Closed notflip closed 8 years ago

notflip commented 8 years ago

Immediatly after install I get the following error when testing in my routes.

FatalErrorException in Facade.php line 218:
Call to undefined method Spatie\Glide\GlideImage::create()

I followed the installation instructions, any idea what I might be doing wrong?

freekmurze commented 8 years ago

The create-method cannot be used in conjunction with the facade. Could you try to replace the create-method by setSourceFile? Please let me know if that works for you.

I'll update the docs to make this more clear.

notflip commented 8 years ago

It's also giving an error (sorry for the late reply)

FatalErrorException in Facade.php line 218:
Call to undefined method Spatie\Glide\GlideImage::setSourceFile()

This is the code i'm using to test

Route::get('/img/{path}', function($path) {
    GlideImage::setSourceFile($path)->outputImage($path, ['w' => 300, 'h' => 400]);
});
freekmurze commented 8 years ago

Are you using the latest version of this package (v3)?

notflip commented 8 years ago

"spatie/laravel-glide": "^2.2". I'll take a look at the latest version. Thank you

prashantidealittechno commented 7 years ago

Hello @notflip Please include the line at the top of the route.php

use Spatie\Glide\GlideImage;