1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- namespace App\Admin\Controllers;
- use App\Models\DiaryMoodLevel;
- use Encore\Admin\Controllers\AdminController;
- use Encore\Admin\Form;
- use Encore\Admin\Grid;
- use Encore\Admin\Show;
- class DiaryMoodLevelController extends AdminController
- {
- /**
- * Title for current resource.
- *
- * @var string
- */
- protected $title = '心情等级';
- /**
- * Make a grid builder.
- *
- * @return Grid
- */
- protected function grid()
- {
- $grid = new Grid(new DiaryMoodLevel());
- $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(DiaryMoodLevel::findOrFail($id));
- $show->field('id', __('Id'));
- $show->field('name', __('Name'));
- $show->field('pic', __('Pic'));
- $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 DiaryMoodLevel());
- $form->text('name', __('级别名'));
- $form->image('pic', __('图片'));
- $form->color('color', __('颜色'));
- $form->number('rank', __('排序 越大越靠前'));
- return $form;
- }
- }
|