链街Dcat后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
1.4 KiB

5 years ago
  1. <?php
  2. namespace App\Admin\Actions\Show;
  3. use Dcat\Admin\Actions\Response;
  4. use Dcat\Admin\Show\AbstractTool;
  5. use Dcat\Admin\Traits\HasPermissions;
  6. use Illuminate\Contracts\Auth\Authenticatable;
  7. use Illuminate\Database\Eloquent\Model;
  8. use Illuminate\Http\Request;
  9. class OrderDetail extends AbstractTool
  10. {
  11. /**
  12. * @return string
  13. */
  14. protected $title = '订单订单详情';
  15. /**
  16. * Handle the action request.
  17. *
  18. * @param Request $request
  19. *
  20. * @return Response
  21. */
  22. public function handle(Request $request)
  23. {
  24. dd($this->getKey());
  25. return $this->response()
  26. ->success('Processed successfully.')
  27. ->redirect('/');
  28. }
  29. /**
  30. * @return string|void
  31. */
  32. protected function href()
  33. {
  34. return admin_url('auth/users');
  35. }
  36. /**
  37. * @return string|array|void
  38. */
  39. public function confirm()
  40. {
  41. return ['Confirm?', 'contents'];
  42. }
  43. /**
  44. * @param Model|Authenticatable|HasPermissions|null $user
  45. *
  46. * @return bool
  47. */
  48. protected function authorize($user): bool
  49. {
  50. return true;
  51. }
  52. // 如果你想自定义动作按钮的HTML,可以重写此方法
  53. public function html()
  54. {
  55. return view('orderdetail');
  56. }
  57. /**
  58. * @return array
  59. */
  60. protected function parameters()
  61. {
  62. return [];
  63. }
  64. }