column('id')->sortable(); $grid->column('avatar')->image('',50); $grid->column('nick_name'); $grid->column('openid'); $grid->column('unionid'); $grid->column('real_name')->editable(); $grid->column('tel'); $grid->column('gender_text'); $grid->column('status')->using(UserModel::$_STATUS)->label(config('label.status_label')); $grid->filter(function (Grid\Filter $filter) { $filter->equal('id'); $filter->like('nick_name'); $filter->like('real_name'); }); $grid->model()->orderBy('id','desc'); // 每页10条 $grid->paginate(10); $grid->disableCreateButton(); $grid->disableDeleteButton(); $grid->disableEditButton(); }); } /** * Make a show builder. * * @param mixed $id * * @return Show */ protected function detail($id) { return Show::make($id, new User(), function (Show $show) { $show->field('id'); $show->field('nick_name'); $show->field('avatar')->image(); $show->field('openid'); $show->field('real_name'); $show->field('tel'); $show->field('unionid'); $show->field('status'); $show->field('country'); $show->field('province'); $show->field('city'); $show->field('gender'); $show->field('language'); $show->field('created_at'); $show->field('updated_at'); $show->panel()->tools(function ($tools) { $tools->disableEdit(); // $tools->disableList(); $tools->disableDelete(); // 显示快捷编辑按钮 // $tools->showQuickEdit(); }); }); } /** * Make a form builder. * * @return Form */ protected function form() { return Form::make(new User(), function (Form $form) { $form->hidden('id'); $form->text('nick_name'); $form->image('avatar'); $form->text('openid'); $form->text('real_name'); $form->tel('tel'); $form->text('unionid'); $form->text('status'); $form->text('country'); $form->text('province'); $form->text('city'); $form->radio('gender')->options(UserModel::$_GENDER); $form->text('language'); $form->disableResetButton(); $form->disableViewCheck(); $form->disableEditingCheck(); $form->disableCreatingCheck(); $form->disableDeleteButton(); }); } }