@@Laratips @foreach($data as $p) {{$loop->index+1}} {{$p->ProductName}} {{$p->ProductPrice}} @foreach($data->comment as $c) {{$c->comment}} @endforeach @endforeach Produt works well but when 1 try to fetch their comments i get this error Property [comment] does not exist on this collection instance.
but with this code it is working now @foreach($data as $p) {{$loop->index+1}} {{$p->ProductName}} {{$p->ProductPrice}} @foreach($data[$loop->index]->comment as $c) {{$c->comment}} @endforeach @endforeach
Very useful brother. Thank you very much.
You are most welcome
sir make more video plz
hello sir at 10:44 to view the values on blade is it still working on Laravel v10.0.3
Yes, it is working.
@@Laratips
@foreach($data as $p)
{{$loop->index+1}}
{{$p->ProductName}}
{{$p->ProductPrice}}
@foreach($data->comment as $c)
{{$c->comment}}
@endforeach
@endforeach
Produt works well but when 1 try to fetch their comments i get this error
Property [comment] does not exist on this collection instance.
but with this code it is working now
@foreach($data as $p)
{{$loop->index+1}}
{{$p->ProductName}}
{{$p->ProductPrice}}
@foreach($data[$loop->index]->comment as $c)
{{$c->comment}}
@endforeach
@endforeach
how i can fix it ?
You don't need to fix it. It is working as is.