在称为qrcode的表中添加清单时,结果输出在此服务器上找不到请求的资源/ qrcodes。
public function store(CreateQrcodeRequest $request)
{
$input = $request->all();
$file = 'qrcodes/'.$qrcode->id.'png';
$newQrcode = QRCode::text("message")
->setSize(4)
->setMargin(2)
->setOutfile($file)
->png();
if($newQrcode){
$input['qrcode_path'] = $file;
$qrcodes = $this->qrcodeRepository->create($input);
Flash::success('Qrcode saved successfully.');
}else{
Flash::error('Qrcode failed to saved successfully.');
}
return redirect(route('qrcodes.show',['qrcode' =>$qrcode]));
}
答案 0 :(得分:2)
view
应该位于resources/views
文件夹中,而不是public
文件夹中