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
highk committed Jan 31, 2023
1 parent 03f08b8 commit 3e903d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 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
6 changes: 3 additions & 3 deletions src/Services/BoardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function ($query) use ($userId) {
]);
}

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

return $query->orderBy('head', 'desc')->get();
}
Expand Down Expand Up @@ -215,7 +215,7 @@ function($query) {
$this->handler->makeWhere($query, $request, $config);
$this->handler->makeOrder($query, $request, $config);

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

if ($id !== null) {
$board = Board::division($boardInstanceId)->newQuery()->find($id);
Expand Down Expand Up @@ -264,7 +264,7 @@ function ($query) {
}
);

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

return $query->take(8)->orderBy('head', 'desc')->get();
}
Expand Down

0 comments on commit 3e903d9

Please sign in to comment.