header(admin_trans_label('post_log')) ->description() ->body($this->grid()); } /** * Make a grid builder. * * @return Grid */ protected function grid() { return Grid::make(SmmPostLog::with(['post', 'account']), function (Grid $grid) { $grid->column('id')->sortable(); $grid->column('account.name', admin_trans_label('account_name')); $grid->column('media_name',admin_trans_label('media_name')); $grid->column('post.message',admin_trans_label('post_message'))->width('30%'); $grid->column('created_at'); $grid->column('status')->using(admin_trans_array(config('dictionary.post_log_status')))->label([ 0 => 'gray', 1 => 'success', 2 => 'orange1', ]); $grid->column('remark')->width('15%'); $grid->column('send_time', admin_trans_label('etd'))->sortable(); $grid->disableRowSelector(); $grid->disableCreateButton(); $grid->disableDeleteButton(); $grid->disableEditButton(); }); } protected function detail($id) { return Show::make($id, SmmPostLog::with(['post', 'account']), function (Show $show) { $show->field('id'); $show->field('account.name', admin_trans_label('account_name')); $show->field('media_name',admin_trans_label('media_name')); $show->field('post.message',admin_trans_label('post_message')); $show->field('remark'); $show->field('send_time', admin_trans_label('etd')); $show->field('created_at'); $show->field('status')->using(admin_trans_array(config('dictionary.post_log_status'))); $show->disableDeleteButton(); }); } }