mirror of
https://github.com/flarum/core.git
synced 2025-10-18 18:26:07 +02:00
A good start I think, but still some work to do. If we go ahead with https://github.com/flarum/core/issues/132#issuecomment-117507974 (which I am in favour of), we can extract the entity-related stuff into some smaller service providers (e.g. discussion repo, an event listener, permissions, and gambits stuff could all go in Flarum\Core\Discussions\DiscussionsServiceProvider).
32 lines
877 B
PHP
32 lines
877 B
PHP
<?php namespace Flarum\Core\Notifications;
|
|
|
|
use Flarum\Support\ServiceProvider;
|
|
use Flarum\Extend;
|
|
|
|
class NotificationsServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Bootstrap the application events.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
$this->extend([
|
|
(new Extend\EventSubscriber('Flarum\Core\Handlers\Events\DiscussionRenamedNotifier')),
|
|
|
|
(new Extend\NotificationType('Flarum\Core\Notifications\DiscussionRenamedNotification'))
|
|
->subjectSerializer('Flarum\Api\Serializers\DiscussionBasicSerializer')
|
|
->enableByDefault('alert')
|
|
]);
|
|
}
|
|
|
|
public function register()
|
|
{
|
|
$this->app->bind(
|
|
'Flarum\Core\Repositories\NotificationRepositoryInterface',
|
|
'Flarum\Core\Repositories\EloquentNotificationRepository'
|
|
);
|
|
}
|
|
}
|