'全匹配', 2 => '输入词包含触发词', 3 => '触发词包含输入词' ]; protected $type_labels = [ 1 => 'green', 2 => 'yellow', 3 => 'orange' ]; /** * Make a grid builder. * * @return Grid */ protected function grid() { return Grid::make(new WxMpMessageReply(), function (Grid $grid) { $grid->model()->orderBy('order', 'desc')->orderBy('id', 'desc'); $grid->column('id')->sortable(); $grid->column('word'); $grid->column('type')->using($this->type_options)->label($this->type_labels); $grid->column('mp_message_id'); $grid->column('order')->editable()->sortable(); $grid->column('status')->switch(); $grid->filter(function (Grid\Filter $filter) { $filter->equal('id'); }); $grid->tools([ new MpMessageButton(), new MpMaterialButton() ]); }); } /** * Make a show builder. * * @param mixed $id * * @return Show */ protected function detail($id) { return Show::make($id, new WxMpMessageReply(), function (Show $show) { $show->field('id'); $show->field('word'); $show->field('type'); $show->field('mp_message_id'); $show->field('order'); $show->field('status'); }); } /** * Make a form builder. * * @return Form */ protected function form() { return Form::make(new WxMpMessageReply(), function (Form $form) { $form->display('id'); $form->html(function (){ return '