mercredi 17 août 2022

How I can convert a dynamic blade content into PDF with mPDF in Laravel 7?

This my frontend.create-cv.pdf.blade.php :

<section>

    <h1>Language</h1>

    @foreach ($data['languages'] as $lang)

        <em> | </em>

    @endforeach

</section>

And this is my controller :

$data['languages'] = language_skill::where('jobseeker_id', $id)->get();

$mpdf->WriteHTML(view('frontend.create-cv.pdf', ['data' => $data]));

I'm geting this error :

Undefined variable: data (View: E:\xampp\htdocs\rzgroup.az\resources\views\frontend\create-cv\pdf.blade.php)`

How can i solve this problem ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire