123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
- namespace App\Admin\Controllers;
- use App\Models\DiaryMoodTag;
- use Encore\Admin\Controllers\AdminController;
- use Encore\Admin\Form;
- use Encore\Admin\Grid;
- use Encore\Admin\Show;
- class DiaryMoodTagController extends AdminController
- {
- /**
- * Title for current resource.
- *
- * @var string
- */
- protected $title = '心情标签';
- /**
- * Make a grid builder.
- *
- * @return Grid
- */
- protected function grid()
- {
- $grid = new Grid(new DiaryMoodTag());
- $grid->column('id', __('Id'));
- $grid->column('name', __('标签名'));
- $grid->column('color', __('颜色'));
- $grid->column('rank', __('排序 越大越靠前'));
- $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(DiaryMoodTag::findOrFail($id));
- $show->field('id', __('Id'));
- $show->field('name', __('Name'));
- $show->field('color', __('Color'));
- $show->field('rank', __('Rank'));
- $show->field('created_at', __('Created at'));
- $show->field('updated_at', __('Updated at'));
- $show->field('deleted_at', __('Deleted at'));
- return $show;
- }
- /**
- * Make a form builder.
- *
- * @return Form
- */
- protected function form()
- {
- $form = new Form(new DiaryMoodTag());
- $form->text('name', __('标签名'));
- $form->color('color', __('颜色'));
- $form->number('rank', __('排序 越大越靠前'));
- return $form;
- }
- }
|