call(function () { $unsent_gpa = DB::table('gpapolicies')->where('sent_mail', 0)->get(); if($unsent_gpa){ foreach($unsent_gpa as $gpa){ // info('ve'); $gpa = DB::table('gpapolicies')->where('gpa_id', $gpa->gpa_id)->first(); $name = ucwords($gpa->first_name); $email = $gpa->email_address; $data = [ 'masterpolicy' => $gpa->masterpolicy_no, 'coc' => str_pad($gpa->coc_no,10,"0",STR_PAD_LEFT), 'policyholder' => strtoupper($gpa->groupPolicy_holder), 'insured' => strtoupper($gpa->first_name.' '.$gpa->middle_name.' '.$gpa->last_name), 'beneficiary' => strtoupper($gpa->beneficiary), 'relationship' => strtoupper($gpa->relationship), 'from' => strtoupper($gpa->from), 'to' => strtoupper($gpa->to), 'vessel' => strtoupper($gpa->vessel), 'date' => date('F j, Y',strtotime($gpa->departure_date)), 'time' => date('H:i',strtotime($gpa->departure_time)), 'issue_date' => date('F j, Y',strtotime($gpa->created_at)), 'amount' => $gpa->amount, 'security_code' => 'https://www.sterling-insurance.com.ph/cocissuance/verify/pa/'.$gpa->security_code, ]; $file = public_path() . '/coc/'.$gpa->transaction_id.'.pdf'; PDF::loadView('coc-pa', $data)->setPaper('Legal', 'portrait')->save($file); // return TRUE; } } })->everyMinute(); } /** * Register the commands for the application. * * @return void */ protected function commands() { $this->load(__DIR__.'/Commands'); require base_path('routes/console.php'); } }