DaitoGoogleChatProvider.php
1.06 KB
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 Daito\Lib\DaitoGoogleChat\Providers;
use Daito\Lib\DaitoGoogleChat\DaitoGoogleChatManager;
use Daito\Lib\DaitoGoogleChat\Services\DaitoGoogleChatWebhookClient;
use Illuminate\Support\ServiceProvider;
class DaitoGoogleChatProvider extends ServiceProvider
{
public function register(): void
{
$this->mergeConfigFrom(
__DIR__ . '/../config/daito-google-chat.php',
'daito-google-chat'
);
$this->app->singleton(DaitoGoogleChatWebhookClient::class, function () {
return new DaitoGoogleChatWebhookClient();
});
$this->app->singleton(DaitoGoogleChatManager::class, function ($app) {
return new DaitoGoogleChatManager(
$app->make(DaitoGoogleChatWebhookClient::class)
);
});
}
public function boot(): void
{
$this->publishes(
array(
__DIR__ . '/../config/daito-google-chat.php' => config_path('daito-google-chat.php'),
),
'daito-google-chat-config'
);
}
}