forked from laravel-notification-channels/intercom
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntercomServiceProvider.php
More file actions
38 lines (34 loc) · 989 Bytes
/
Copy pathIntercomServiceProvider.php
File metadata and controls
38 lines (34 loc) · 989 Bytes
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
<?php
namespace NotificationChannels\Intercom;
use Illuminate\Container\Container;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\ServiceProvider;
use Intercom\IntercomClient;
class IntercomServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*/
public function boot(): void
{
$this->app->when(IntercomChannel::class)
->needs(IntercomClient::class)
->give(static function () {
/* @var Config $config */
return new IntercomClient(
Config::get('services.intercom.token', ''),
null
);
});
}
/**
* Register any package services.
*/
public function register(): void
{
Notification::extend('intercom', static function (Container $app) {
return $app->make(IntercomChannel::class);
});
}
}