header('邮件日志') ->description('') ->body($this->grid()); } /** * Show interface. * * @param mixed $id * @param Content $content * @return Content */ public function show($id, Content $content) { return $content ->header('邮件日志') ->description('详细') ->body($this->detail($id)); } /** * Make a grid builder. * * @return Grid */ protected function grid() { $grid = new Grid(new EmailLog); $grid->model()->orderBy('id', 'desc'); $grid->id('ID'); $grid->send_from('发送账号'); $grid->send_to('发送地址'); $grid->subject('邮件主题'); $grid->status('状态')->display(function ($status) { if ($status == 1) { return '成功'; } elseif ($status==2) { return '失败'; } else { return '待发送'; } }); $grid->created_at('添加时间'); $grid->updated_at('更新时间'); $grid->disableActions(); return $grid; } /** * Make a form builder. * * @return Form */ protected function form() { $form = new Form(new EmailLog); $form->display('ID'); $form->display('Created at'); $form->display('Updated at'); return $form; } }