header('列表') ->description('全部') ->breadcrumb(['text'=>'列表','url'=>'']) ->body($this->grid()); } /** * Make a grid builder. * * @return Grid */ protected function grid() { return Grid::make(new SitePost(), function (Grid $grid) { $grid->column('id')->sortable(); $grid->column('title'); $grid->column('content'); $grid->column('slug'); $grid->column('status'); $grid->column('author'); $grid->column('post_date'); $grid->column('created_at'); $grid->column('updated_at')->sortable(); $grid->filter(function (Grid\Filter $filter) { $filter->equal('id'); }); }); } /** * Make a show builder. * * @param mixed $id * * @return Show */ protected function detail($id) { return Show::make($id, new SitePost(), function (Show $show) { $show->field('id'); $show->field('title'); $show->field('content'); $show->field('slug'); $show->field('status'); $show->field('author'); $show->field('post_date'); $show->field('created_at'); $show->field('updated_at'); }); } /** * Make a form builder. * * @return Form */ protected function form() { return Form::make(new SitePost(), function (Form $form) { $form->display('id'); $form->text('title'); $form->text('content'); $form->text('slug'); $form->text('status'); $form->text('author'); $form->text('post_date'); $form->display('created_at'); $form->display('updated_at'); }); } }