samalapsy's avatar

Adding watermark to Image using Image Intervention

Please how can I add watermark to my uploaded image. It's working with the code below.

$image = $request->file('banner');
$slug= "bgh-dsd";
$key=0;
$fileName = "img-".$slug."-".$key. "." . strtolower($image->getClientOriginalExtension());
                $destinationPath = $path;


                
                //Upload Images One After the Order into folder
                $img = Image::make($image->getRealPath());
                $watermark = Image::make(public_path('/img/logo.png'));                
                $img->insert($watermark, 'bottom-right', 10, 10);
                $img->save($destinationPath.'/'.$fileName);
                $move = $image->move($destinationPath, $fileName);

Thanks In Anticipation

0 likes
1 reply
samalapsy's avatar
samalapsy
OP
Best Answer
Level 2

Gotten the answer I only removed this line

 $move = $image->move($destinationPath, $fileName);

Please or to participate in this conversation.