| @@ 50-63 (lines=14) @@ | ||
| 47 | * |
|
| 48 | * @return bool |
|
| 49 | */ |
|
| 50 | public function categoryWasChanged(CategoryWasChangedEvent $event) |
|
| 51 | { |
|
| 52 | $data = [ |
|
| 53 | 'loggable_id' => $event->conversation->getKey(), |
|
| 54 | 'loggable_type' => get_class($event->conversation), |
|
| 55 | 'event_type' => CategoryWasChangedEvent::class, |
|
| 56 | 'data' => [ |
|
| 57 | 'old' => $event->oldCategory, |
|
| 58 | 'new' => $event->category |
|
| 59 | ] |
|
| 60 | ]; |
|
| 61 | ||
| 62 | return $this->create($data); |
|
| 63 | } |
|
| 64 | ||
| 65 | /** |
|
| 66 | * Handle a ConversationWasLocked event. |
|
| @@ 108-120 (lines=13) @@ | ||
| 105 | * |
|
| 106 | * @return bool |
|
| 107 | */ |
|
| 108 | public function postWasDeleted(PostWasDeletedEvent $event) |
|
| 109 | { |
|
| 110 | $data = [ |
|
| 111 | 'loggable_id' => $event->conversation->getKey(), |
|
| 112 | 'loggable_type' => get_class($event->conversation), |
|
| 113 | 'event_type' => PostWasDeletedEvent::class, |
|
| 114 | 'data' => [ |
|
| 115 | 'post_user_id' => $event->user->getKey() |
|
| 116 | ] |
|
| 117 | ]; |
|
| 118 | ||
| 119 | return $this->create($data); |
|
| 120 | } |
|
| 121 | ||
| 122 | /** |
|
| 123 | * Handle a TitleWasChanged event. |
|
| @@ 129-142 (lines=14) @@ | ||
| 126 | * |
|
| 127 | * @return bool |
|
| 128 | */ |
|
| 129 | public function titleWasChanged(TitleWasChangedEvent $event) |
|
| 130 | { |
|
| 131 | $data = [ |
|
| 132 | 'loggable_id' => $event->conversation->getKey(), |
|
| 133 | 'loggable_type' => get_class($event->conversation), |
|
| 134 | 'event_type' => TitleWasChangedEvent::class, |
|
| 135 | 'data' => [ |
|
| 136 | 'old' => $event->oldTitle, |
|
| 137 | 'new' => $event->title |
|
| 138 | ] |
|
| 139 | ]; |
|
| 140 | ||
| 141 | return $this->create($data); |
|
| 142 | } |
|
| 143 | ||
| 144 | /** |
|
| 145 | * Create the log. |
|