| xqd
@@ -0,0 +1,74 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace App\Admin\Controllers;
|
|
|
+
|
|
|
+use App\Admin\Repositories\VipCombo;
|
|
|
+use Dcat\Admin\Form;
|
|
|
+use Dcat\Admin\Grid;
|
|
|
+use Dcat\Admin\Show;
|
|
|
+use Dcat\Admin\Http\Controllers\AdminController;
|
|
|
+
|
|
|
+class VipComboController extends AdminController
|
|
|
+{
|
|
|
+ /**
|
|
|
+ * Make a grid builder.
|
|
|
+ *
|
|
|
+ * @return Grid
|
|
|
+ */
|
|
|
+ protected function grid()
|
|
|
+ {
|
|
|
+ return Grid::make(new VipCombo(), function (Grid $grid) {
|
|
|
+ $grid->column('id')->sortable();
|
|
|
+ $grid->column('name');
|
|
|
+ $grid->column('price');
|
|
|
+ $grid->column('valid_day');
|
|
|
+ $grid->column('desc');
|
|
|
+ $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 VipCombo(), function (Show $show) {
|
|
|
+ $show->field('id');
|
|
|
+ $show->field('name');
|
|
|
+ $show->field('price');
|
|
|
+ $show->field('valid_day');
|
|
|
+ $show->field('desc');
|
|
|
+ $show->field('created_at');
|
|
|
+ $show->field('updated_at');
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Make a form builder.
|
|
|
+ *
|
|
|
+ * @return Form
|
|
|
+ */
|
|
|
+ protected function form()
|
|
|
+ {
|
|
|
+ return Form::make(new VipCombo(), function (Form $form) {
|
|
|
+ $form->display('id');
|
|
|
+ $form->text('name');
|
|
|
+ $form->text('price');
|
|
|
+ $form->text('valid_day');
|
|
|
+ $form->text('desc');
|
|
|
+
|
|
|
+ $form->display('created_at');
|
|
|
+ $form->display('updated_at');
|
|
|
+ });
|
|
|
+ }
|
|
|
+}
|