本文整理匯總了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>";