column('id')->sortable(); $grid->column('name'); $grid->column('img')->image(config("filesystems.disks.cosv5.url"),60,60); $grid->column('short_name'); $grid->column('medal_name'); $grid->column('room_id'); $grid->column('sort')->editable(true); $grid->column('is_show_share')->using(['隐藏','显示']); // $grid->column('created_at'); $grid->column('updated_at')->sortable(); $grid->enableDialogCreate(); $grid->setDialogFormDimensions('50%', '60%'); $grid->withBorder(); $grid->actions(function (Grid\Displayers\Actions $actions) { $actions->quickEdit(true); $actions->disableEdit(); $actions->disableView(); }); $grid->model()->orderBy("sort","asc")->orderBy("id","asc"); }); } /** * Make a show builder. * * @param mixed $id * * @return Show */ protected function detail($id) { return Show::make($id, new LiveRoom(), function (Show $show) { $show->field('id'); $show->field('name'); $show->field('img'); $show->field('short_name'); $show->field('room_id'); $show->field('sort'); $show->field('is_show_share'); $show->field('created_at'); $show->field('updated_at'); }); } /** * Make a form builder. * * @return Form */ protected function form() { return Form::make(new LiveRoom(), function (Form $form) { // $form->display('id'); $form->text('name')->required(); $form->image('img')->autoUpload()->removable(false)->autoSave(false)->uniqueName()->required(); $form->text('short_name')->required(); $form->text('medal_name'); $form->text('room_id')->required(); $form->number('sort')->default(0)->help("显示的顺序,默认从小到大显示"); $form->switch('is_show_share')->help("用来控制在H5页面的试衣间上传皮肤后的弹窗中是否显示"); }); } }