where('identity',$ic)->get(); return view('mobile-responsive.compound_list_result', compact('compound','site')); } public function requestCompoundPaymentPdf($kpd) { $ready_view_pdf = false; $availablePDF = array(); $now = Carbon::now()->format('d/m/Y h:i:s A'); $compound = Compound::with('ConfidentialFile','Attachment','CompoundInvestigation')->where('kpd', $kpd)->first(); $file = ConfidentialFile::with(['Memo' => function($q){ $q->orderBy('updated_at','ASC'); }],['Investigation' => function($q){ $q->orderBy('updated_at','ASC'); }],'ItemInventory')->where('_id',$compound->ConfidentialFile->_id)->first(); $destinationPath = 'document/'.$compound->ConfidentialFile->no_siri.'/pdf'; if(!File::exists(public_path().'/'.$destinationPath)) { File::makeDirectory(public_path().'/'.$destinationPath, $mode = 0777, true, true); } /** ** Compound **/ $tawaran = ''; if($compound->jumlah_kemaskini_kompaun == ''){ $tawaran = $compound->jumlah_asal_kompaun; }else{ $tawaran = $compound->jumlah_kemaskini_kompaun; } $site = SiteSetting::first(); $staff = Staff::with('StaffDetail')->where('no_badan', $compound->dikeluarkan)->first(); $department = Department::where('jbkod', $staff->StaffDetail->jbkod)->first(); $akta = DeedLaw::where('akkod', $compound->akta)->first(); $faulty = Faulty::where('itkod',$compound->seksyen_kesalahan)->first(); return view('mobile-responsive.compound_detail', compact('compound','staff','department','akta','faulty','picArray','tawaran','site')); } }