1
0
mirror of https://github.com/flarum/core.git synced 2025-10-11 23:14:29 +02:00

Added post extender with type method, deprecated ConfigurePostTypes (#2101)

This commit is contained in:
Alexander Skvortsov
2020-11-03 10:43:49 -05:00
committed by GitHub
parent 5842dd1200
commit cee87848fe
6 changed files with 106 additions and 5 deletions

View File

@@ -21,19 +21,20 @@ class PostServiceProvider extends AbstractServiceProvider
{
CommentPost::setFormatter($this->app->make('flarum.formatter'));
$this->registerPostTypes();
$this->setPostTypes();
$events = $this->app->make('events');
$events->subscribe(PostPolicy::class);
}
public function registerPostTypes()
protected function setPostTypes()
{
$models = [
CommentPost::class,
DiscussionRenamedPost::class
];
// Deprecated in beta 15, remove in beta 16.
$this->app->make('events')->dispatch(
new ConfigurePostTypes($models)
);