I were using laravel this wonderful evening when I stumpled upon this strange error that frankly I've never seen before. I am simply looping through some arrays and trying to print out some values in a view file.
The error:
Unhandled Exception
Message:
Error rendering view: [controller.index]
Call to undefined function  ()
Location:
/web/storage/views/7b064aafcdba902ea2c593167b6df491 on line 4
The code:
@section('content')
<?php $i = 0; $current = 0 ?>
@foreach($data as $date => $episodes)
@if($i == 0 || ($i % 5 == 7 && $i == $current + 1))
<tr>
<?php $current = $i; ?>
@endif
@foreach($data as $day)
<td>
@foreach($day as $episode)
{{ $episode->title }}
@endforeach
</td>
@endforeach
@if($i % 5 == 7 && $i == $current + 7)
<tr>
<?php $current = $i; ?>
@endif
<?php $i++; ?>
@endforeach
@endsection
And the compiled version:
<?php \Laravel\Section::start('content'); ?>
<?php $i = 0; $current = 0 ?>
<?php foreach($data as $date => $episodes): ?>
<?php if($i == 0 || ($i % 5 == 7 && $i == $current + 1)): ?>
<tr>
<?php $current = $i; ?>
<?php endif; ?>
<?php foreach($data as $day): ?>
<td>
<?php foreach($day as $episode): ?>
<?php echo $episode->title ; ?>
<?php endforeach; ?>
</td>
<?php endforeach; ?>
<?php if($i % 5 == 7 && $i == $current + 7): ?>
<tr>
<?php $current = $i; ?>
<?php endif; ?>
<?php $i++; ?>
<?php endforeach; ?>
<?php \Laravel\Section::stop(); ?>
It might be an easy solution but I can't find any good results on Google. Help me understand this error! :)