123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?php
- namespace App\Distributor\Controllers;
- use App\Distributor\Repositories\SmmPostLog;
- use Dcat\Admin\Form;
- use Dcat\Admin\Grid;
- use Dcat\Admin\Show;
- use Dcat\Admin\Http\Controllers\AdminController;
- use Dcat\Admin\Layout\Content;
- use Dcat\Admin\Admin;
- class SmmPostLogController extends AdminController
- {
- /**
- * page index
- */
- public function index(Content $content)
- {
- return $content
- ->header('列表')
- ->description('全部')
- ->breadcrumb(['text'=>'列表','url'=>''])
- ->body($this->grid());
- }
- /**
- * Make a grid builder.
- *
- * @return Grid
- */
- protected function grid()
- {
- return Grid::make(new SmmPostLog(), function (Grid $grid) {
- $grid->column('id')->sortable();
- $grid->column('post_id');
- $grid->column('account_id');
- $grid->column('status');
- $grid->column('remark');
- $grid->column('dist_id');
- $grid->column('request_content');
- $grid->column('response_content');
- $grid->column('media_name');
- $grid->column('response_ids');
- $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 SmmPostLog(), function (Show $show) {
- $show->field('id');
- $show->field('post_id');
- $show->field('account_id');
- $show->field('status');
- $show->field('remark');
- $show->field('dist_id');
- $show->field('request_content');
- $show->field('response_content');
- $show->field('media_name');
- $show->field('response_ids');
- $show->field('created_at');
- $show->field('updated_at');
- });
- }
- /**
- * Make a form builder.
- *
- * @return Form
- */
- protected function form()
- {
- return Form::make(new SmmPostLog(), function (Form $form) {
- $form->display('id');
- $form->text('post_id');
- $form->text('account_id');
- $form->text('status');
- $form->text('remark');
- $form->text('dist_id');
- $form->text('request_content');
- $form->text('response_content');
- $form->text('media_name');
- $form->text('response_ids');
- $form->display('created_at');
- $form->display('updated_at');
- });
- }
- }
|