1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace App\Admin\Controllers;
- use App\Models\ActivityRange;
- use Encore\Admin\Controllers\AdminController;
- use Encore\Admin\Form;
- use Encore\Admin\Grid;
- use Encore\Admin\Show;
- class ActivityRangeController extends AdminController
- {
- /**
- * Title for current resource.
- *
- * @var string
- */
- protected $title = 'ActivityRange';
- /**
- * Make a grid builder.
- *
- * @return Grid
- */
- protected function grid()
- {
- $grid = new Grid(new ActivityRange());
- $grid->column('id', __('Id'));
- $grid->column('name', __('区域名称'));
- // $grid->column('created_at', __('创建时间'));
- // $grid->column('updated_at', __('修改时间'));
- return $grid;
- }
- /**
- * Make a show builder.
- *
- * @param mixed $id
- * @return Show
- */
- protected function detail($id)
- {
- $show = new Show(ActivityRange::findOrFail($id));
- $show->field('id', __('Id'));
- $show->field('name', __('区域名称'));
- $show->field('created_at', __('创建时间'));
- $show->field('updated_at', __('修改时间'));
- return $show;
- }
- /**
- * Make a form builder.
- *
- * @return Form
- */
- protected function form()
- {
- $form = new Form(new ActivityRange());
- $form->text('name', __('区域名称'));
- return $form;
- }
- }
|