| @@ 61-68 (lines=8) @@ | ||
| 58 | * |
|
| 59 | * @return null|\Xetaravel\Models\DiscussCategory |
|
| 60 | */ |
|
| 61 | public function getOldCategoryAttribute() |
|
| 62 | { |
|
| 63 | if ($this->event_type !== CategoryWasChangedEvent::class) { |
|
| 64 | return null; |
|
| 65 | } |
|
| 66 | ||
| 67 | return DiscussCategory::find($this->data['old']); |
|
| 68 | } |
|
| 69 | ||
| 70 | /** |
|
| 71 | * Get the new category. |
|
| @@ 75-82 (lines=8) @@ | ||
| 72 | * |
|
| 73 | * @return null|\Xetaravel\Models\DiscussCategory |
|
| 74 | */ |
|
| 75 | public function getNewCategoryAttribute() |
|
| 76 | { |
|
| 77 | if ($this->event_type !== CategoryWasChangedEvent::class) { |
|
| 78 | return null; |
|
| 79 | } |
|
| 80 | ||
| 81 | return DiscussCategory::find($this->data['new']); |
|
| 82 | } |
|
| 83 | } |
|
| 84 | ||