NoticeSend.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace App\Admin\Actions\Notice;
  3. use Dcat\Admin\Grid\RowAction;
  4. use Dcat\Admin\Widgets\Modal;
  5. class NoticeSend extends RowAction
  6. {
  7. protected $title = '推送用户';
  8. protected $model;
  9. public function __construct(string $model = null)
  10. {
  11. $this->model = $model;
  12. }
  13. /**
  14. * 设置确认弹窗信息,如果返回空值,则不会弹出弹窗
  15. *
  16. * 允许返回字符串或数组类型
  17. *
  18. * @return array|string|void
  19. */
  20. public function confirm()
  21. {
  22. }
  23. /**
  24. * 处理请求
  25. *
  26. * @param Request $request
  27. *
  28. * @return \Dcat\Admin\Actions\Response
  29. */
  30. public function handle(Request $request)
  31. {
  32. return $this->response()
  33. ->success('Processed successfully: '.$this->getKey())
  34. ->redirect('/');
  35. }
  36. /**
  37. * 设置要POST到接口的数据
  38. *
  39. * @return array
  40. */
  41. public function parameters()
  42. {
  43. return [];
  44. }
  45. public function render()
  46. {
  47. $form = UserCheck::make()->payload(['id'=>$this->getKey()]);
  48. return Modal::make()
  49. ->lg()
  50. ->title($this->title)
  51. ->body($form)
  52. ->button('<i class="feather icon-settings"></i> '.$this->title);
  53. }
  54. }