芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/kwesioben.com/paymoney/app/DataTables/Admin/CountriesDataTable.php
eloquent($this->query()) ->editColumn('is_default', function ($country) { return isDefault($country->is_default); }) ->addColumn('action', function ($country) { $edit = (Common::has_permission(auth('admin')->user()->id, 'edit_country')) ? '
' : ''; $delete = (Common::has_permission(auth('admin')->user()->id, 'delete_country')) ? '
' : ''; return $edit . $delete; }) ->rawColumns(['is_default', 'action']) ->make(true); } /** * Get the query object to be processed by dataTables. * * @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder|\Illuminate\Support\Collection */ public function query() { $query = Country::select(); return $this->applyScopes($query); } /** * Optional method if you want to use html builder. * * @return \Yajra\Datatables\Html\Builder */ public function html() { return $this->builder() ->addColumn(['data' => 'id', 'name' => 'countries.id', 'title' => __('ID'), 'searchable' => false, 'visible' => false]) ->addColumn(['data' => 'short_name', 'name' => 'countries.short_name', 'title' => __('Short Name')]) ->addColumn(['data' => 'name', 'name' => 'countries.name', 'title' => __('Long Name')]) ->addColumn(['data' => 'iso3', 'name' => 'countries.iso3', 'title' => __('Iso3')]) ->addColumn(['data' => 'number_code', 'name' => 'countries.number_code', 'title' => __('Num Code')]) ->addColumn(['data' => 'phone_code', 'name' => 'countries.phone_code', 'title' => __('Phone Code')]) ->addColumn(['data' => 'is_default', 'name' => 'countries.is_default', 'title' => __('Default')]) ->addColumn(['data' => 'action', 'name' => 'action', 'title' => __('Action'), 'orderable' => false, 'searchable' => false]) ->parameters(dataTableOptions()); } }