I am not sure what you mean? I assume $item is a model so how do you mean that it's empty? Do you mean that {{$item->nom}} outputs nothing?
Also please format your code by adding ``` on the line before and after it
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi I'm trying to pass a data to my view fro dompdf but I cannot my controller creatpdf function $orm = (new ordreResource(Ordremouvement::find($id)))->resolve();
$projectO = $orm['chantierOrigin'];
$projectD = $orm['chantierDestination'];
$emps = $orm['employes'];
$dateplustot = $orm['dateplutot'];
$dateplustard = $orm['dateplutard'];//*/
$pdf = PDF::loadView('ordrem',compact('projectO','projectD','emps','dateplustot','dateplustard'));
$pdf->setPaper('a4','landscape');
return $pdf->download('om.pdf');//*/
on my view fro dompdf I have this
@foreach ($emps as $item) {{$item->nom}} {{$item->prenom}} {{$item->dateNaissance }} / / / {{ $dateplustot }} {{ $dateplustot }} {{ $dateplustard }} {{ $dateplustard }} @endforeach
the $item is empty i get nothing from it however i get the value of others any solutions !!
Please or to participate in this conversation.