-
Notifications
You must be signed in to change notification settings - Fork 454
/
NotificationServiceProvider.php
60 lines (53 loc) · 2.07 KB
/
NotificationServiceProvider.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace Concrete\Core\Notification;
use Concrete\Core\Application\Application;
use Concrete\Core\Foundation\Service\Provider as ServiceProvider;
use Concrete\Core\Notification\Events\MercureService;
use Concrete\Core\Notification\Type\UserDeactivatedType;
use Symfony\Component\Mercure\PublisherInterface;
class NotificationServiceProvider extends ServiceProvider
{
public function register()
{
$this->app->singleton(
'Concrete\Core\Notification\Type\Manager',
function ($app) {
$manager = new Type\Manager($app);
$manager->driver('core_update');
$manager->driver('new_conversation_message');
$manager->driver('new_form_submission');
$manager->driver('new_private_message');
$manager->driver('user_signup');
$manager->driver('workflow_progress');
$manager->driver('group_signup_request');
$manager->driver('group_signup');
$manager->driver('group_role_change');
$manager->driver('group_create');
$manager->driver('group_signup_request_accept');
$manager->driver('group_signup_request_decline');
$manager->driver(UserDeactivatedType::IDENTIFIER);
return $manager;
}
);
$this->app->singleton(
'manager/notification/types',
function ($app) {
return $app->make('Concrete\Core\Notification\Type\Manager');
}
);
$this->app->singleton(
'manager/notification/subscriptions',
function ($app) {
return $app->make('Concrete\Core\Notification\Subscription\Manager');
}
);
$this->app->singleton(MercureService::class);
$this->app->singleton(
PublisherInterface::class,
function (Application $app) {
$service = $app->make(MercureService::class);
return $service->getPublisher();
}
);
}
}