本文整理汇总了PHP中app\Group::select方法的典型用法代码示例。如果您正苦于以下问题:PHP Group::select方法的具体用法?PHP Group::select怎么用?PHP Group::select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Group
的用法示例。
在下文中一共展示了Group::select方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index(Datatables $datatables)
{
if ($this->currentUser->hasAccess('wts.group.show')) {
if ($datatables->getRequest()->ajax()) {
$groups = Group::select(['id', 'name', 'slug', 'created_at', 'updated_at']);
return Datatables::of($groups)->addColumn('action', function ($group) {
if ($this->currentUser->hasAccess('wts.group.edit')) {
$edit = $this->createEditButton('/admin/groups/' . $group->slug . '/edit');
} else {
$edit = '';
}
if ($this->currentUser->hasAccess('wts.group.delete')) {
$delete = $this->createDeleteButton($group->id, 'admin.groups.destroy');
} else {
$delete = '';
}
return $edit . ' ' . $delete;
})->make(true);
}
$html = $datatables->getHtmlBuilder()->addColumn(['data' => 'name', 'name' => 'name', 'title' => 'Grup Adı'])->addColumn(['data' => 'created_at', 'name' => 'created_at', 'title' => 'Created At'])->addColumn(['data' => 'updated_at', 'name' => 'updated_at', 'title' => 'Updated At'])->addColumn(['data' => 'action', 'name' => 'action', 'title' => 'İşlemler', 'orderable' => false, 'searchable' => false])->parameters(array('order' => [1, 'desc']));
$data = ['menu' => 'groups', 'page_title' => 'Gruplar', 'page_description' => 'Sistem Kullanıcılarına Atanacak İzin Grupları Bu Sayfada Yer Almaktadır'];
return view('admin.user-group.group.index', $data)->with(compact('html'));
} else {
abort(403, $this->accessForbidden);
}
}
示例2: dataTable
/**
* Process datatables ajax request.
*
* @return \Illuminate\Http\JsonResponse
*/
public function dataTable()
{
$records = Group::select('id', 'group_name', 'assigned_barangay', 'created_at');
return Datatables::of($records)->addColumn('action', function ($record) {
return '<a title="View" href="/group/' . $record->id . '" class="btn btn-xs blue"><i class="fa fa-search"></i></a>
<a title="Edit" href="/group/' . $record->id . '/edit" class="btn btn-xs green"><i class="fa fa-edit"></i></a>';
})->make(true);
}