本文整理汇总了PHP中Teacher::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Teacher::all方法的具体用法?PHP Teacher::all怎么用?PHP Teacher::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Teacher
的用法示例。
在下文中一共展示了Teacher::all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showTeachers
public function showTeachers()
{
$teachers = Teacher::all();
if (Auth::Admin()->check()) {
return Response::json($teachers);
} else {
return Redirect::intended('/');
}
}
示例2:
{{$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>";