|
@@ -3,67 +3,19 @@
|
|
namespace App\Admin\Controllers;
|
|
namespace App\Admin\Controllers;
|
|
|
|
|
|
use App\Admin\Repositories\Test;
|
|
use App\Admin\Repositories\Test;
|
|
|
|
+use App\Http\Controllers\Controller;
|
|
use Dcat\Admin\Form;
|
|
use Dcat\Admin\Form;
|
|
use Dcat\Admin\Grid;
|
|
use Dcat\Admin\Grid;
|
|
use Dcat\Admin\Show;
|
|
use Dcat\Admin\Show;
|
|
-use Dcat\Admin\Http\Controllers\AdminController;
|
|
|
|
use Carbon\Carbon;
|
|
use Carbon\Carbon;
|
|
|
|
|
|
-class TestController extends AdminController
|
|
|
|
-{
|
|
|
|
- /**
|
|
|
|
- * Make a grid builder.
|
|
|
|
- *
|
|
|
|
- * @return Grid
|
|
|
|
- */
|
|
|
|
- protected function grid()
|
|
|
|
- {
|
|
|
|
- return Grid::make(new Test(), function (Grid $grid) {
|
|
|
|
- $grid->view('admin.grid.table');
|
|
|
|
- $grid->column('id')->sortable();
|
|
|
|
- $grid->column('name');
|
|
|
|
- $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 Test(), function (Show $show) {
|
|
|
|
- $show->field('id');
|
|
|
|
- $show->field('name');
|
|
|
|
- $show->field('created_at');
|
|
|
|
- $show->field('updated_at');
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
- * Make a form builder.
|
|
|
|
- *
|
|
|
|
- * @return Form
|
|
|
|
- */
|
|
|
|
- protected function form()
|
|
|
|
- {
|
|
|
|
- return Form::make(new Test(), function (Form $form) {
|
|
|
|
- $form->display('id');
|
|
|
|
-
|
|
|
|
- $form->image('name')->saving(function ($name) {
|
|
|
|
- return $name;
|
|
|
|
- // var_dump($name);exit;
|
|
|
|
- });
|
|
|
|
|
|
+class TestController extends Controller
|
|
|
|
+{
|
|
|
|
|
|
- $form->display('created_at');
|
|
|
|
- $form->display('updated_at');
|
|
|
|
- });
|
|
|
|
|
|
+ public function index()
|
|
|
|
+ {
|
|
|
|
+ echo '123';exit;
|
|
}
|
|
}
|
|
}
|
|
}
|