How do you get students in your controller?
Nov 21, 2019
10
Level 11
Empty output in blade view
Hi, somehow my foreach loop code is showing an empty output in the blade view. jus wondering am I doing anything wrong here? Thanks in advance.
@section('content')
<div class="row">
<table class="table table-hover">
<caption>List of Students</caption>
<thead>
<tr>
<th scope="col">Id</th>
<th scope="col">name</th>
<th scope="col">number</th>
</tr>
</thead>
<tbody>
@foreach($students as $student)
<tr>
<th scope="row">1</th>
<td>{{ $student['id'] }}</td>
<td>{{ $student['name'] }}</td>
<td>{{ $student['number'] }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endsection
Please or to participate in this conversation.