BladeOne icon indicating copy to clipboard operation
BladeOne copied to clipboard

Foreach returning error

Open ghost opened this issue 2 years ago • 3 comments

Hi,

I am looping through an array using @foreach but it throughs this error:

syntax error, unexpected token ";"

The compiled file shows $__currentLoopData = ;

Any ideas what could be causing this, or is it a bug?

ghost avatar Jul 29 '23 10:07 ghost

Do you still have this problem? If this problem has already been resolved, this issue can be closed.

Can you share an example data? @foreach is not enough. This must be done with a variable, for example: @foreach($items as $item).

reindert-vetter avatar Sep 10 '23 21:09 reindert-vetter

No I had to use a standard for loop, the foreach did have an array assigned. I am busy at the moment, but when I have time I will send across the full code.

ghost avatar Sep 10 '23 21:09 ghost