disableRowSelector(); $grid->disableCreateButton(); $grid->disableActions(); $grid->column('id')->sortable(); $grid->column('agent.name', '所属代理商'); $grid->column('avatar')->image('', 60, 60); $grid->column('mobile'); $grid->column('nickname'); $grid->column('status')->bool(); $grid->column('created_at'); $grid->column('updated_at'); $grid->filter(function (Grid\Filter $filter) { $filter->panel(); $filter->equal('id')->width(1); $filter->equal('mobile')->width(2); }); }); } /** * Make a show builder. * * @param mixed $id * * @return Show */ protected function detail($id) { return Show::make($id, new User(['agent:id,name']), function (Show $show) { $show->disableDeleteButton(); $show->field('id'); $show->field('agent.name', '代理商'); $show->field('avatar')->image('', 80, 80); $show->field('mobile'); $show->field('nickname'); $show->field('status')->bool(); $show->field('created_at'); $show->field('updated_at'); }); } /** * Make a form builder. * * @return Form */ protected function form() { return Form::make(new User(), function (Form $form) { $form->disableDeleteButton(); /*$form->display('id'); $form->text('status');*/ })->deleting(function (Form $form) { return $form->response()->error('禁止删除'); }); } }