| @@ 75-86 (lines=12) @@ | ||
| 72 | * |
|
| 73 | * @return bool |
|
| 74 | */ |
|
| 75 | public function postWasSolved(PostWasSolvedEvent $event) |
|
| 76 | { |
|
| 77 | $data = [ |
|
| 78 | 'user_id' => $event->post->user_id, |
|
| 79 | 'amount' => $this->experiences[PostWasSolvedEvent::class], |
|
| 80 | 'obtainable_id' => $event->post->getKey(), |
|
| 81 | 'obtainable_type' => get_class($event->post), |
|
| 82 | 'event_type' => PostWasSolvedEvent::class |
|
| 83 | ]; |
|
| 84 | ||
| 85 | return $this->create($data); |
|
| 86 | } |
|
| 87 | ||
| 88 | /** |
|
| 89 | * Handle a ConversationWasCreated event. |
|
| @@ 95-105 (lines=11) @@ | ||
| 92 | * |
|
| 93 | * @return bool |
|
| 94 | */ |
|
| 95 | public function conversationWasCreated(ConversationWasCreatedEvent $event) |
|
| 96 | { |
|
| 97 | $data = [ |
|
| 98 | 'amount' => $this->experiences[ConversationWasCreatedEvent::class], |
|
| 99 | 'obtainable_id' => $event->conversation->getKey(), |
|
| 100 | 'obtainable_type' => get_class($event->conversation), |
|
| 101 | 'event_type' => ConversationWasCreatedEvent::class |
|
| 102 | ]; |
|
| 103 | ||
| 104 | return $this->create($data); |
|
| 105 | } |
|
| 106 | ||
| 107 | /** |
|
| 108 | * Create the experience. |
|