简体   繁体   English

Laravel 媒体 - 插入水印(快速管理面板)

[英]Laravel Media - insert watermark (Quick Admin Panel)

I'm using Quick Admin panel for my project and now I need to insert watermark on every image.我正在为我的项目使用快速管理面板,现在我需要在每张图片上插入水印。 This is my store function in my contoller:这是我的控制器中的store function

if ($request->input('thumbnail', false)) {
   $automobil->addMedia(storage_path('tmp/uploads/' . $request->input('thumbnail')))->toMediaCollection('thumbnail');
}

foreach ($request->input('fotografije', []) as $file) {
   $automobil->addMedia(storage_path('tmp/uploads/' . $file))->toMediaCollection('fotografije');
}

How can I insert watermark in this code?如何在此代码中插入水印? I tried like:我试过像:

$file->insert(public_path('images/watermark/watermark.png'), 'bottom-right', 10, 10);

but it's not working.但它不起作用。 Please help.请帮忙。

Hi @Milos you can use this additional package: Intervention image and add a watermark using it.嗨@Milos,您可以使用这个额外的 package:干预图像并使用它添加水印。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM