UserWithdrawController.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. namespace App\Admin\Controllers;
  3. use App\Admin\Repositories\UserWithdraw;
  4. use Dcat\Admin\Form;
  5. use Dcat\Admin\Grid;
  6. use Dcat\Admin\Show;
  7. use Dcat\Admin\Http\Controllers\AdminController;
  8. class UserWithdrawController extends AdminController
  9. {
  10. /**
  11. * Make a grid builder.
  12. *
  13. * @return Grid
  14. */
  15. protected function grid()
  16. {
  17. return Grid::make(new UserWithdraw(), function (Grid $grid) {
  18. $grid->column('id')->sortable();
  19. $grid->column('user_id');
  20. $grid->column('name');
  21. $grid->column('type');
  22. $grid->column('account');
  23. $grid->column('price');
  24. $grid->column('desc');
  25. $grid->column('status');
  26. $grid->column('created_at');
  27. $grid->column('updated_at')->sortable();
  28. $grid->filter(function (Grid\Filter $filter) {
  29. $filter->equal('id');
  30. });
  31. });
  32. }
  33. /**
  34. * Make a show builder.
  35. *
  36. * @param mixed $id
  37. *
  38. * @return Show
  39. */
  40. protected function detail($id)
  41. {
  42. return Show::make($id, new UserWithdraw(), function (Show $show) {
  43. $show->field('id');
  44. $show->field('user_id');
  45. $show->field('name');
  46. $show->field('type');
  47. $show->field('account');
  48. $show->field('price');
  49. $show->field('desc');
  50. $show->field('status');
  51. $show->field('created_at');
  52. $show->field('updated_at');
  53. });
  54. }
  55. /**
  56. * Make a form builder.
  57. *
  58. * @return Form
  59. */
  60. protected function form()
  61. {
  62. return Form::make(new UserWithdraw(), function (Form $form) {
  63. $form->display('id');
  64. $form->text('user_id');
  65. $form->text('name');
  66. $form->text('type');
  67. $form->text('account');
  68. $form->text('price');
  69. $form->text('desc');
  70. $form->text('status');
  71. $form->display('created_at');
  72. $form->display('updated_at');
  73. });
  74. }
  75. }