1 | <?php |
||
8 | class TopicUpVoted extends Event |
||
9 | { |
||
10 | use SerializesModels, ShouldNotifyTrait; |
||
11 | |||
12 | /** |
||
13 | * 设置生成的通知类型. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $notification_type = 'topic_upvote'; |
||
18 | |||
19 | /** |
||
20 | * Create a new event instance. |
||
21 | * |
||
22 | * @param Topic $topic 被赞用户 |
||
23 | * @param $by_user int 点赞用户 |
||
24 | */ |
||
25 | public function __construct(Topic $topic, $by_user) |
||
29 | |||
30 | /** |
||
31 | * Get the channels the event should be broadcast on. |
||
32 | * |
||
33 | * @return array |
||
34 | */ |
||
35 | public function broadcastOn() |
||
39 | } |
||
40 |