<?php
 namespace Module\VipArticle\Admin\Controller; use Illuminate\Routing\Controller; use ModStart\Admin\Concern\HasAdminQuickCRUD; use ModStart\Admin\Layout\AdminCRUDBuilder; use ModStart\Grid\GridFilter; use ModStart\Support\Concern\HasFields; class VipArticleController extends Controller { use HasAdminQuickCRUD; protected function crud(AdminCRUDBuilder $builder) { $builder ->init('vip_article') ->field(function ($builder) { $builder->id('id','ID'); $builder->select('categoryId', '分类')->optionModelTree('vip_article_category', 'id', 'pid', 'name'); $builder->text('title', '标题'); $builder->currency('fee', '费用')->help('留空表示免费'); $builder->richHtml('previewContent', '未付费查看内容')->listable(false); $builder->richHtml('content', '完整内容')->listable(false); $builder->display('created_at', L('Created At'))->listable(false); $builder->display('updated_at', L('Updated At'))->listable(false); }) ->gridFilder(function (GridFilter $filter) { $filter->eq('id', L('ID')); $filter->like('title', L('Title')); }) ->title('付费内容'); } }