From 025a2026e112fa8c969308846f73f9c08af0777d Mon Sep 17 00:00:00 2001 From: Amirah22 <94591077+Amirah22@users.noreply.github.com> Date: Sun, 30 Jan 2022 09:49:10 +0800 Subject: [PATCH] marhun to pdf export marhun(senarai lelong) to pdf --- app/Http/Controllers/MarhunController.php | 24 +++- resources/views/marhun/marhun.blade.php | 6 +- resources/views/pdf/marhundetails.blade.php | 131 ++++++-------------- routes/web.php | 2 + 4 files changed, 64 insertions(+), 99 deletions(-) diff --git a/app/Http/Controllers/MarhunController.php b/app/Http/Controllers/MarhunController.php index ac7340fb..1907ba44 100644 --- a/app/Http/Controllers/MarhunController.php +++ b/app/Http/Controllers/MarhunController.php @@ -102,7 +102,29 @@ class MarhunController extends Controller $emasall = JenisEmas::all(); return view('marhun.marhun',compact('marhun','lelongbid','karatall','emasall')); - } + } + + + public function exportmarhundetails(Request $request) + { + $lelongbid = LelongBid::where('id','=',$request->lelongbid)->first(); + $marhun = LelongBidMarhun::where('lelongbid_id','=',$request->lelongbid)->get(); + + $karatall = JenisKarat::all(); + $emasall = JenisEmas::all(); + + + + $pdf = PDF::loadView('pdf.marhundetails',compact('marhun', + 'lelongbid', + 'karatall', + + 'emasall'))->setPaper('a4', 'landscape'); + + return $pdf->download('Senarai Lelong Details.pdf'); + + + } } \ No newline at end of file diff --git a/resources/views/marhun/marhun.blade.php b/resources/views/marhun/marhun.blade.php index 1e948987..a29602d8 100644 --- a/resources/views/marhun/marhun.blade.php +++ b/resources/views/marhun/marhun.blade.php @@ -10,8 +10,10 @@
{{ $message }}
@endif -