header('header'); $content->description('description'); $content->body($this->grid()); }); } /** * Edit interface. * * @param $id * @return Content */ public function edit($id) { return Admin::content(function (Content $content) use ($id) { $content->header('header'); $content->description('description'); $content->body($this->form()->edit($id)); }); } /** * Create interface. * * @return Content */ public function create() { return Admin::content(function (Content $content) { $content->header('header'); $content->description('description'); $content->body($this->form()); }); } /** * Make a grid builder. * * @return Grid */ protected function grid() { return Admin::grid(YourModel::class, function (Grid $grid) { $grid->id('序号')->sortable(); $grid->created_at(); $grid->updated_at(); }); } /** * Make a form builder. * * @return Form */ protected function form() { return Admin::form(YourModel::class, function (Form $form) { $form->display('id', '序号'); $form->display('created_at', 'Created At'); $form->display('updated_at', 'Updated At'); }); } }