芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/kwesioben.com/paymoney/app/DataTables/Admin/RolesDataTable.php
query(); return datatables() ->of($role) ->addColumn('action', function ($role) { $edit = (Common::has_permission(auth('admin')->user()->id, 'edit_role')) ? '
' : ''; $delete = (Common::has_permission(auth('admin')->user()->id, 'delete_role')) ? '
' : ''; return $edit . $delete; }) ->addColumn('name', function ($role) { return (Common::has_permission(auth('admin')->user()->id, 'edit_role')) ? '
' . ucfirst($role->name) . '
' : ucfirst($role->name); }) ->editColumn('display_name', function ($role) { return ucfirst($role->display_name); }) ->editColumn('description', function ($role) { return ucfirst($role->description); }) ->rawColumns(['name', 'action']) ->make(true); } public function query() { $role = Role::where(['user_type' => 'Admin'])->select(); return $this->applyScopes($role); } public function html() { return $this->builder() ->addColumn(['data' => 'id', 'name' => 'roles.id', 'title' => __('ID'), 'searchable' => false, 'visible' => false]) ->addColumn(['data' => 'name', 'name' => 'roles.name', 'title' => __('Name')]) ->addColumn(['data' => 'display_name', 'name' => 'roles.display_name', 'title' => __('Display Name')]) ->addColumn(['data' => 'description', 'name' => 'roles.description', 'title' => __('Description')]) ->addColumn(['data' => 'action', 'name' => 'action', 'title' => 'Action', 'orderable' => false, 'searchable' => false]) ->parameters(dataTableOptions()); } }