column('id', __('Id')); $grid->column('type', __('类型'))->display(function($type){ return SysVersion::$typeMap[$type]; }); $grid->column('version_number', __('版本号')); $grid->column('description', __('版本更新说明')); $grid->column('web_url', __('版本下载网址')); $grid->column('aos_url', __('安卓下载地址')); $grid->column('ios_url', __('苹果下载地址')); $grid->column('is_must', __('是否强制更新'))->display(function($isMust){ return SysVersion::$isMustMap[$isMust]; }); return $grid; } /** * Make a show builder. * * @param mixed $id * @return Show */ protected function detail($id) { $show = new Show(SysVersion::findOrFail($id)); $show->field('id', __('Id')); $show->field('type', __('Type')); $show->field('version_number', __('Version number')); $show->field('description', __('Description')); $show->field('web_url', __('Web url')); $show->field('aos_url', __('Aos url')); $show->field('ios_url', __('Ios url')); $show->field('is_must', __('Is must')); $show->field('created_at', __('Created at')); $show->field('updated_at', __('Updated at')); $show->field('deleted_at', __('Deleted at')); return $show; } /** * Make a form builder. * * @return Form */ protected function form() { $form = new Form(new SysVersion()); $form->select('type', __('类型'))->options(SysVersion::$typeMap); $form->text('version_number', __('版本号')); $form->text('description', __('版本更新说明')); $form->file('web_url', __('版本下载网址')); $form->text('aos_url', __('安卓下载地址')); $form->text('ios_url', __('苹果下载地址')); $form->switch('is_must', __('是否强制更新')); return $form; } }