column('id'); $grid->column('company_name', 'Company Name'); $grid->column('country', 'Country'); $grid->column('site_name', 'Site Name'); $grid->column('domain_type',admin_trans_label('domain'))->display(function ($domainType) { $title = ""; if ($domainType == 0) { $title = $this->secondary_domain; } else { $title = $this->custom_domain; } return "$title"; }); //$grid->column('created_at'); //$grid->column('updated_at'); // 指定行选择器选中时显示的值的字段名称 // 指定行选择器选中时显示的值的字段名称 // 指定行选择器选中时显示的值的字段名称 // 如果表格数据中带有 “name”、“title”或“username”字段,则可以不用设置 $grid->rowSelector()->titleColumn('company_name'); $grid->quickSearch(['id', 'company_name', 'level_domain']); $grid->paginate(10); $grid->disableActions(); $grid->filter(function (Grid\Filter $filter) { $filter->like('company_name')->width(4); $filter->like('level_domain', 'Level Domain')->width(4); }); $grid->model()->where('enabled', 1); }); } }