Md Manna
Md Manna

Reputation: 61

"Call to undefined method Intervention\Image\Image::make()"

When I used Laravel Intervention image in localhost then it's working perfect but this when upload live server in my control panel then it's not working...

enter image description here

Upvotes: 3

Views: 11897

Answers (3)

Lokman Hosen
Lokman Hosen

Reputation: 482

If you are using "imageIntervention" V3 and face this error then you have to update some function because fome functions are replaced.

  1. Image::make() relpaced by Image::read().
  2. Image::canvas() replaced by Image::create() and so on. Just replace function. Worked for me, hope work for you.

Reference: https://image.intervention.io/v3/introduction/upgrade

Upvotes: 0

Ashwani Singh
Ashwani Singh

Reputation: 159

Note: This solution is for v3 of the intervention image package.

1- In your controller add the following line:

use Intervention\Image\Laravel\Facades\Image;

2- Image::make() will not work with v3. Instead of it, use

Image::read($file);

for more info follow the links: https://image.intervention.io/v3

https://image.intervention.io/v3/modifying/resizing

Upvotes: 4

Mr Mohamed
Mr Mohamed

Reputation: 464

in config/app.php

In the $providers array add the service providers for this package.

Intervention\Image\ImageServiceProvider::class

Add the facade of this package to the $aliases array.

'Image' => Intervention\Image\Facades\Image::class

according to this link http://image.intervention.io/getting_started/installation

or at the head of your controller add this after installing it:-

use Intervention\Image\ImageManagerStatic as Image;

Upvotes: 7

Related Questions