Try this.
<img src="{{ assets('imagen.png') }}">
You have the idea, but you will probably have to customize the path, it depends on the folder in which the image is.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have an html where I want to insert an image which is displayed when downloading the pdf, but it doesn't show it to me, I already tried public_path() and other solutions and it still doesn't work, my html looks like this:
img src="/assets/imagen.png" style="max-width: 100px;" Reporte de Documentaciones Completas e Incompletas por Año Proceso "A"
<table>
<thead>
<tr>
<th>Año</th>
<th>Documentaciones Completas</th>
<th>Documentaciones Incompletas</th>
</tr>
</thead>
<tbody>
@foreach ($anioCompletas as $anio => $completas)
<tr>
<td>{{ $anio }}</td>
<td>{{ $completas }}</td>
<td>{{ $anioIncompletas[$anio] }}</td>
</tr>
@endforeach
</tbody>
</table>
and the method like this
public function generarPDF() { $datos = $this->graficaDocumentacionCompletaPorAnio();
// Aquí deberías pasar las variables en un array asociativo
$viewData = [
'anioCompletas' => $datos['anioCompletas'],
'anioIncompletas' => $datos['anioIncompletas'],
// ... Otras variables que necesites pasar
];
$html = view('procesoA.reporteA', $viewData)->render();
$dompdf = new Dompdf();
$dompdf->loadHtml($html);
$dompdf->render();
return $dompdf->stream("reporte.pdf");
}
Currently I am only occupying that
Please or to participate in this conversation.