laravel图片问题:
我有我的代码来存储图像,它是:
$img = Image::make(asset('public/storage/assets/'.$product->image));
$img->insert(asset('template/images/logo-1000frases-w.png'), 'bottom-left', 10, 10);
$img->save(public_path('public/storage/assets/'.$product->image));
我在图像上添加水印然后存储它 .
问题是..当我尝试存储图像时,它说:
Unable to init from given url (http://138.197.121.221/public/storage/assets/ijTdImC4dIcobYa1QSDA59oDiF8J8e0FjQS1EG3n.jpeg).
但我有正确的道路......公共,存储,资产,所有这些都存在;我想知道它会是什么?
谢谢!
2 回答
你可以用这种方式在laravel 5中上传你的imgae
图像是请求图像的关键 . $ folderPath变量用于保存在数据库表中 . 这可能对你有用
我可以得到一个解决方案:
然后:
这就是它! :d