我想在提交带有所有数据和附件(文件,图像)的表格后发送邮件。 我猜它返回字符串值。如何解决这个问题。
Controller.php
$fileNameToStore= $filename.'_'.time().'.'.$extension;
//upload image
$path = $request->file('file')->storeAs('Circularfs',$fileNameToStore);
//dd($path);
}else{
$fileNameToStore = 'noimage.jpg';
}
$cfile = new circularfs;
$cfile->title = $request->input('title');
$cfile->department = $request->input('department');
$cfile->file = $fileNameToStore;
$cfile->save();
$to_email = "abc@gmail.com";
\Mail::to($to_email)->send(new \App\Mail\circularfs($cfile));
App\Mail\circularfs.php错误屏幕截图位于
答案 0 :(得分:0)
您可以在此处显示您的表单代码吗? 您使用的是enctype =“ multipart / form-data”还是'files'=> true?
<form method="POST" action="http://example.com" enctype="multipart/form-data">
</form>
{!! Form::open(['url' => route('myRoute'), 'method' => 'post', 'files' => true]) !!}