simplePaginate(); $grid->model()->orderBy('id', 'desc'); $grid->column('id')->sortable(); $grid->column('user_id'); $grid->column('comment_id'); $grid->column('comment_user_id'); $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 WxCommentLike(), function (Show $show) { $show->field('id'); $show->field('user_id'); $show->field('comment_id'); $show->field('comment_user_id'); $show->field('created_at'); $show->field('updated_at'); }); } /** * Make a form builder. * * @return Form */ protected function form() { return Form::make(new WxCommentLike(), function (Form $form) { $form->display('id'); $form->text('user_id'); $form->text('comment_id'); $form->text('comment_user_id'); $form->deleting(function (Form $form){ global $__MINI_GLOBAL_TENANT_ID__; if($__MINI_GLOBAL_TENANT_ID__ > 0){ return $form->response()->error('权限不足,不可以删除其他分站对象'); } }); }); } }