column('id')->sortable(); $grid->column('title'); $grid->column('type')->display(function (){ if($this->type == 1){ return '连续包月'; }else{ return '一次性支付'; } })->label(); $grid->column('describe'); $grid->column('money'); $grid->column('month'); $grid->column('updated_at')->sortable(); $grid->disableFilter(); $grid->disableViewButton(); $grid->actions(function (Grid\Displayers\Actions $actions) { $actions->disableQuickEdit(); $actions->disableView(); }); }); } /** * Make a show builder. * * @param mixed $id * * @return Show */ protected function detail($id) { return Show::make($id, new UserMember(), function (Show $show) { $show->field('id'); $show->field('title'); $show->field('describe'); $show->field('money'); $show->field('content'); $show->field('created_at'); $show->field('updated_at'); }); } /** * Make a form builder. * * @return Form */ protected function form() { return Form::make(new UserMember(), function (Form $form) { $form->display('id')->width(4); $form->radio('type')->options([ 1 => '连续包月', 2 => '一次性支付', ])->default(1); $form->text('title')->width(4)->required(); $form->text('describe')->width(4); $form->decimal('money')->width(4)->required(); $form->number('month')->min(1)->width(4)->default(1)->required(); // $form->editor('content'); $form->disableViewButton(); $form->disableDeleteButton(); }); } }