I have a collection with a relationship in Laravel 5.4. I want to loop through it using a for loop.
If I do (testing):
{{ $application->kids[0]->name }}
{{ $application->kids[1]->name }}
everything works.
But if I put index in kids array:
{{ $application->kids[$i]->name }}
it throws a 500 error.
I'm using native php loop: for($i = 0; $i < 5; $i++){}
What am I missing?
`<?php for($i = 0; $i < 5; $i++) { ?> `
<input type="text" value="{{ $application->kids[$i]->name }}">
<?php } ?>
@for($i = 0;$i < 2; $i++) ... @endfor?