public function showTeachers() { $teachers = Teacher::all(); if (Auth::Admin()->check()) { return Response::json($teachers); } else { return Redirect::intended('/'); } }
{{$breadcrumbs}} </div> <table class="table table-striped table-bordered bootstrap-datatable datatable"> <thead> <tr> <th>#ID</th> <th>First Name</th> <th>Last Name</th> <th>Date of Birth</th> <th>Status</th> <th>Actions</th> </tr> </thead> <tbody> <?php $teachers = Teacher::all(); foreach ($teachers as $teacher) { $user = Sentry::findUserByLogin($teacher->email); echo "<tr>"; echo "<td>"; echo $teacher->user_id; echo "</td>"; echo "<td>"; echo $user->first_name; echo "</td>"; echo "<td>"; echo $user->last_name; echo "</td>"; echo "<td>"; echo $teacher->dob; echo "</td>";