categories)->title; }; } public function make() { $this->model()->where('status', 1); $this->column('id', 'ID'); $this->column('title', '分类名称'); $this->column('type', '类型')->using(Category::TYPES); $this->filter(function (Filter $filter) { $filter->like('title', '分类名称'); $filter->equal('parent.id', '所属分类') ->select(Category::selectOptions(function ($model) { return $model->where('status', 1) ->whereIn('type', [Category::TYPE_ARTICLE, Category::TYPE_LINK]); }, '所有分类')); $filter->equal('type', '类型')->select(Category::TYPES); }); } }