ChatAction.php 1.3 KB

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