Skip to content
Advertisement

how to get nth row in foreach loop in laravel blade?

consider i have 2 table like this

remaining | c_remaining

0 | 10

20 | 30

40 | 50

i want 10 – 20 , 30 – 40 and 50 – 0 and i want it in foreach loop

JavaScript

how i can how i can skip first value and get value from next from current 1?

Advertisement

Answer

You can try to shape the data in the controller itself.

JavaScript

Then in the blade view you can use the new property

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement