Skip to content

Commit

Permalink
#346 Use dispatch method instead of fire method.
Browse files Browse the repository at this point in the history
  • Loading branch information
xharpenParksuhyeon committed Feb 1, 2023
1 parent f5e8937 commit 7278b0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Controllers/ArchivesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ protected function setCurrentPage(
});
}

Event::fire('xe.plugin.board.archive', [$query, $slug->board]);
Event::dispatch('xe.plugin.board.archive', [$query, $slug->board]);
$count = $query->count() ? : 1;

$page = (int)($count / $config->get('perPage'));
Expand Down
4 changes: 2 additions & 2 deletions src/Services/BoardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function getNoticeItems(Request $request, ConfigEntity $config, $userId)
$favoriteQuery->where('user_id', Auth::user()->getId());
}, 'slug', 'data', 'thumb', 'tags']);

Event::fire('xe.plugin.board.notice', [$query]);
Event::dispatch('xe.plugin.board.notice', [$query]);

return $query->get();
}
Expand Down Expand Up @@ -164,7 +164,7 @@ public function getItems(Request $request, ConfigEntity $config, $id = null)
$favoriteQuery->where('user_id', Auth::user()->getId());
}, 'slug', 'data', 'thumb']);

Event::fire('xe.plugin.board.articles', [$query]);
Event::dispatch('xe.plugin.board.articles', [$query]);

if ($id !== null) {
$item = Board::division($config->get('boardId'))->find($id);
Expand Down

0 comments on commit 7278b0f

Please sign in to comment.