UserActionEvent.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * Author: 芸众商城 www.yunzshop.com
  5. * Date: 23/02/2017
  6. * Time: 21:32
  7. */
  8. namespace app\common\events;
  9. use Illuminate\Queue\SerializesModels;
  10. use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
  11. class UserActionEvent extends Event
  12. {
  13. use SerializesModels;
  14. public $uid,$adminName,$model,$aid,$type,$content;
  15. /**
  16. * userActionEvent constructor.
  17. * @param string $model 被操作的模型
  18. * @param int $aid 被操作ID
  19. * @param int $type 类型 1:添加,2:删除,3:修改更新
  20. * @param string $content 操作详情
  21. */
  22. public function __construct($model, $aid, $type, $content)
  23. {
  24. $this->uid = session('user_id');
  25. $this->adminName = session('name');
  26. $this->model = $model;
  27. $this->aid = $aid;
  28. $this->type = $type;
  29. $this->content = $content;
  30. }
  31. /**
  32. * Get the channels the event should be broadcast on.
  33. *
  34. * @return array
  35. */
  36. public function broadcastOn()
  37. {
  38. return [];
  39. }
  40. }