1 | <?php |
||
12 | class BadgeSubscriber |
||
13 | { |
||
14 | /** |
||
15 | * Register the listeners for the subscriber. |
||
16 | * |
||
17 | * @param Illuminate\Events\Dispatcher $events |
||
18 | * |
||
19 | * @return void |
||
20 | */ |
||
21 | public function subscribe($events) |
||
33 | |||
34 | /** |
||
35 | * Listener related to the comment badge. |
||
36 | * |
||
37 | * @param \Xetaravel\Events\CommentEvent $event The event that was fired. |
||
38 | * |
||
39 | * @return bool |
||
40 | */ |
||
41 | public function onNewComment(CommentEvent $event): bool |
||
54 | |||
55 | /** |
||
56 | * Listener related to the register badge. |
||
57 | * |
||
58 | * @param \Xetaravel\Events\RegisterEvent $event The event that was fired. |
||
59 | * |
||
60 | * @return bool |
||
61 | */ |
||
62 | public function onNewRegister(RegisterEvent $event): bool |
||
78 | |||
79 | /** |
||
80 | * Send a notification for each new badge unlocked. |
||
81 | * |
||
82 | * @param array $result The result of the synchronization. |
||
83 | * @param \Illuminate\Database\Eloquent\Collection $badges The badges collection related to the listener. |
||
84 | * @param \Xetaravel\Models\User $user The user to nitify. |
||
85 | * |
||
86 | * @return bool |
||
87 | */ |
||
88 | protected function sendNotifications(array $result, Collection $badges, User $user): bool |
||
104 | } |
||
105 |