i haven't got this able to work. I have been googled this for days so hopefully someone can help me or shed light for this.
I have installed Laravel by using composer and practiced programming a simple application. Then i wanted to carry on programming another application and i copied all the folders of my previous (very first) laravel project into another folder inside the htdocs folders. I am using XAMPP on windows.
Then i did the same and have four projects in different folders. I changed the original folder name of my very first laravel app in order to keep track of what i have been programming.
So now i am stuck in image uploading in another project. I downloaded the Intervention/image package by using Composer, it did well, I typed composer require intervention image and it was installed successfully.
Then i ran into this error:
Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_ERROR) Class 'Image' not found
Then i thought that possibly composer installed it into my original laravel project. I have tested all my applications by calling this image class and i still get this error. Now i am lost, i don't know where the intervention/image package was installed :( I don't find a folder that is named intervention or something like that.
Tell me how i can find out where is composer pointing to or installing the new packages?
I have also tried configuring the intervention/image in all the projects i have according to this website: http://image.intervention.io/getting_started/installation And it says to add the following two lines in app/config/app.php
"In the $providers array add the service providers for this package.
'Intervention\Image\ImageServiceProvider'
Add the facade of this package to the $aliases array.
'Image' => 'Intervention\Image\Facades\Image' "
And i Have done that in all the applications and i get still another error:
Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_ERROR)
Class 'Intervention\Image\ImageServiceProvider' not found
My code in the controller files looks like this so far:
//UPLOAD PICTURE
public function getUploadPicture(){
return View::make('account.uploadpicture');
}
//POST función que sube la foto del usuario
public function postUploadPicture(){
var_dump($image=Input::file('photo'));
$image=Input::file('photo');
var_dump($image->getRealPath());
Image::make($image->getRealPath());
die();
return Redirect::route('account-upload-picture')
->with('global','<div class="alert alert-success" role="alert">
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Cerrar</span></button>
¡La foto se ha enviado exitosamente!</div>')
->withInput();
}
So now i have three questions,
You'll need to add the package to your composer file. In laravel's project root, open up the composer.json
file and add "intervention/image": "2.*",
to the require
section of the json. Then run composer update to fetch the package.