I'm trying to create a working image upload in a form using Laravel 5 and Intervention.
public function store()
{
$input = Request::all();
Project::create($input);
if (Input::hasFile('image'))
{
$file = Input::file('image');
$file->move('uploads', $file->getClientOriginalName());
$image = Image::make(sprintf('uploads/%s', $file->getClientOriginalName()))->resize(120, 120)->save();
}
return $file;
// return redirect('projects');
}
It's copying the image in the specified folder but when I return $file it gives me something in the lines of
/tmp/phpoMwrrD
Instead of the file name. I've been looking over the Intervention documentation, but can't find what I'm doing wrong.
Quoting the documentation;
Handling image uploads in Laravel
In a Laravel application it is also possible to pass an uploaded file directly to the make method.
Creating Image from File Upload in Laravel
// resizing an uploaded file Image::make(Input::file('photo'))->resize(300, 200)->save('foo.jpg');
Thanks in advance.