option('lid'); // if (!empty($lid)) { $lid = [35192,99282,101778,102427,103558,104991,105088,105182,107628,107800,107965,108418,108491,108631,109289,109358,109849,109942,109961,110110,110195,110504,110537,110538,110541,110566,110574,110592,110631,110642,110680,110683,110688,110692,110706,110714,110716,110728,110731,110735,110739,110749,110750,110771,110791,110861,110867,110868,110885,110888,110905,110926,110936,110965,111019,111028,111044,111046,111048,111050,111055,111071,111088,111099,111101,111115,111121,111211,111218,111227,111239,111240,111301,111465,111470,111472,111509,111577,111579,111582,111583,111593,111614,111630,111678,111738,111781,111799,111859,111865,111867,111875,111895,111896,111922,111973,111976,111983,112066,112076,112099,112104,112144,112190,112193,112200,112201,112230,112254,112286,112327,112328,112409,112457,112474,112492,112543,112567,112599,112601,112606,112617,112623,112628,112640,112649,112653,112701,112710,112744,112795,112853,112891,112961,112963,112985,113010,113033,113064,113078,113136,113137,113159,113161,113173,113212,113214,113237,113241,113245,113327,113331,113359,113363,113395,113400,113428,113473,113538,113541,113579,113617,113625,113696,113704,113779,113783,113792,113798,113809,113811,113833,113837,113880,113882,113954,113956,113959,113993,113999,114019,114023,114085,114088,114099,114114,114118,114126,114136,114155,114162,114200,114201,114202,114216,114219,114230,114270,114274,114333,114356,114370,114441,114448,114457,114458,114477,114481,114541,114542,114547,114553,114555,114580,114582,114615,114622,114626,114645,114729,114736,114741,114751,114776,114790,114801,114829,114854,114876,114877,114886,114916,114922,114923,114929,114938,114976,114984,114990,115011,115016,115034,115045,115047,115083,115090,115100,115114,115131,115180,115206,115213,115218,115239,115254,115305,115326,115356,115363,115371,115394,115412,115425,115961,116183]; // } // if (!empty($lid)) { $done = $undone = []; foreach ($lid as $id) { try { $docObj = (new ConsumerDocument(new Request(['type' => 'Sanction Letter', 'bot' => 1, 'test_bot' => 1]))); $documentDetails = $docObj->getDocument($id); // if (isset($documentDetails['user']['purpose_of_the_loan']) && $documentDetails['user']['purpose_of_the_loan'] != 'Personal Loan') { // if(!isset($application->id)) { // if (isset($documentDetails['user']['mandatory_document_list']) && $documentDetails['user']['mandatory_document_list']){ // $documentDetails['user']['mandatory_document_list'] = array_merge($documentDetails['user']['mandatory_document_list'], ['pan_card']); // }else{ // $documentDetails['user']['mandatory_document_list'] = ['pan_card']; // } // } // } $proforma_view = 'admin.documents.per_forma_invoice'; $view = view($proforma_view, $documentDetails); $pdf = App::make('snappy.pdf.wrapper'); $proformaInvoice = $pdf->loadHTML($view); //Storage::disk('storage')->put('Pro.pdf', $proformaInvoice->output()); $docObj->uploadToS3('Pro Forma Invoice', $id, $proformaInvoice->output()); unset($docObj, $documentDetails, $view, $pdf, $proformaInvoice); $this->info($id. " performa invoice generated successfully"); $done[] = $id; } catch (\Exception $e) { $undone[] = [$id, $e->getMessage().' '.$e->getFile().' '.$e->getLine()]; $this->error($e->getMessage().' '.$e->getFile().' '.$e->getLine()); continue; } } print_r($done); print_r($undone); // } else { // $this->error("Command expects --lid parameter as well"); // } } }