<?php
 namespace App\Admin\Controller; use Illuminate\Routing\Controller; use ModStart\Admin\Concern\HasAdminQuickCRUD; use ModStart\Admin\Layout\AdminCRUDBuilder; use ModStart\Field\Tags; use ModStart\Field\Type\FieldRenderMode; use ModStart\Grid\GridFilter; use ModStart\Support\Concern\HasFields; class BlogController extends Controller { use HasAdminQuickCRUD; protected function crud(AdminCRUDBuilder $builder) { $builder ->init('blog') ->field(function ($builder) { $builder->id('id', 'ID'); $builder->switch('isPublished', '发布')->optionsYesNo(); $builder->datetime('postTime', '发布时间'); $builder->tags('tag', '标签') ->serializeType(Tags::SERIALIZE_TYPE_COLON_SEPARATED) ->tagModelField('blog', 'tag', Tags::SERIALIZE_TYPE_COLON_SEPARATED); $builder->text('title', '标题'); $builder->text('seoKeywords', 'SEO关键词')->listable(false); $builder->text('seoDescription', 'SEO描述')->listable(false); $builder->textarea('summary', '摘要')->listable(false); $builder->images('images', '图片')->listable(false); $builder->richHtml('content', '内容'); $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', '标题'); }) ->title('留言管理'); } }