lundi 16 août 2021

PDF not generated in laravel

I'm generating pdf using following code in Laravel but the issue is sometimes data is saved in the database and pdf is not generated when i check the pdf folder there is no pdf files with that name, this does not happens every time i generate the pdf but there are some entries in my database for which the pdf is not generated, i want some way so that i can check whether the pdf has been generated and mark status true in the database if pdf is generated later on recreate pdf and send it to user through cron jobs or is there any other way also, Please suggest some solution Thanks

   use PDF;
    ..
    ..
    $DataStore->user_id = $user_id;
    $DataStore->description = $description;
    $DataStore->save();
    if($DataStore) {

    $pdf = PDF::loadView('/admin/user_submission_pdf', ['data' => $DataStore]);
    $content = $pdf->download()->getOriginalContent();
    Storage::put('public/pdfFiles/' . $DataStore->Id . '.pdf', $content);
   


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire