-
Notifications
You must be signed in to change notification settings - Fork 12
/
NotificationServiceProvider.php
44 lines (37 loc) · 1.1 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
<?php
namespace Illuminate\Notifications;
use Illuminate\Contracts\Notifications\Dispatcher as DispatcherContract;
use Illuminate\Contracts\Notifications\Factory as FactoryContract;
use Illuminate\Support\ServiceProvider;
class NotificationServiceProvider extends ServiceProvider
{
/**
* Boot the application services.
*
* @return void
*/
public function boot()
{
$this->loadViewsFrom(__DIR__.'/resources/views', 'notifications');
if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__.'/resources/views' => $this->app->resourcePath('views/vendor/notifications'),
], 'laravel-notifications');
}
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->singleton(ChannelManager::class, fn ($app) => new ChannelManager($app));
$this->app->alias(
ChannelManager::class, DispatcherContract::class
);
$this->app->alias(
ChannelManager::class, FactoryContract::class
);
}
}