我試圖節省干預圖像編碼到特定的存儲保存文件到存儲干預編碼
$converted_image = Image::make($req->file('image_file'));
$converted_image->resize(300, null, function ($constraint) {
$constraint->aspectRatio();
});
$file=$converted_image->encode('png');
$path = Storage::putFileAs('images', $file->stream(), 'test.png');
後返回一個錯誤:
$path = Storage::putFileAs('images', $file->stream()->__toString(), 'test.png');
:
Call to undefined method GuzzleHttp\Psr7\Stream::getRealPath()
與另一種嘗試
錯誤:
Call to a member function getRealPath() on string
任何解決方法使用存儲保存文件?
@ user947668沒有這充分回答你的問題? – Dominic