1
dompdf를 사용하여 내 laravel 5.4 응용 프로그램에서 pdf 파일을 다운로드하려고합니다. 여기 내 컨트롤러 코드 :왜 숫자가 아닌 값이 있습니까?
public function htmltopdfview($master_id){
$ordermaster=DB::table('allorder')->where([['user_id',Auth::user()->id],['id',$master_id]])->first();
$orderdetails=DB::table('allorder_details')->where('master_id',$master_id)->get();
$pdf = PDF::loadView('OrderReport',compact('ordermaster','orderdetails'));
return $pdf->download('invoice.pdf');
return view('OrderReport',compact('ordermaster','orderdetails'));
}
그리고 이것은 내보기 블레이드 파일 코드 :
Route::get('htmltopdfview/{id}','[email protected]')->name('pdfdownload');
오류 스크린 샷 : got this error non-numeric value encountered
여기
@foreach($orderdetails as $details)
<tr>
<td class="col-md-9"><em>{{$details->product}}</em></td>
<td class="col-md-1" style="text-align: center">{{$details->product_price}} TK </td>
<td class="col-md-1" style="text-align: center">${{$details->product_price/80}} </td>
<td class="col-md-1 text-center">{{$details->barnd}}</td>
</tr>
@endforeach
<div>
<h1 style="text-align:center;">
Thank you for your order.
<a href="{{route('pdfdownload',$ordermaster->id)}}">Download PDF</a>
</h1>
</div>
나의 길이다 이걸 도와주세요. 미리 감사드립니다.