I can’t export pdf in laravel with dompd

  dompdf, jquery, laravel, php

this is the function where i am trying to create the pdf

    public function generar_pdf(Request $request){

    $num_cont_vale = $request->get('num_cont_vale');
    $fecha_inicial = $request->get('fecha_inicial');
    $fecha_final   = $request->get('fecha_final');
    $dni           = $request->get('dni');
    $num_patente   = $request->get('num_patente');
    $cod_obra      = $request->get('cod_obra'); 
    $origen        = $request->get('origen');
    $destino       = $request->get('destino');
    $material      = $request->get('material');

       ->whereHas('canteras', function ($query) use ($material) {
            $query->where('material', 'LIKE', "$material");

        $data = [
            'comisiones'=> $comisiones,
         // view
         $pdf = PDF::loadView('pdf.comisionesdni', $data);
         return $pdf->stream('comisionesdni.pdf');

I need to print the data to the blade view but the data passes null

Source: Laravel

Leave a Reply