This will do that for you:
$img = Image::make('foo.jpg')->resize(320, 240)->insert('watermark.png');
Documentation: http://image.intervention.io/
If you need more information watch these videos:
I am aware of the process of the uploads. But I'm little confused here.
Basically I am trying to take the upload image from html form and resize it and save it. For this I'm using Intervention/image package. And this package have a save() method already. So after saving I want to remove the uploaded image from the temp folder.
@SachinAgarwal
1 - you can retreive the file's temp name using the getRealPath() method on the file:
$file = $request->file('myfile');
var_dump($file->getRealPath()); // will dump something like /tmp/phpZNWzmr
2- Or is that Laravel rename the temp name of file to client's original name?
No.
3- If I do move() will it be removed from temp folder?
At the end of script execution php will remove the files from tmp directory. So, unless you are renaming the file inside the tmp directory you don't need to worry about that. Just move it to your intended location.
Usman.
Please or to participate in this conversation.