clrghouz/app/Providers/AppServiceProvider.php

45 lines
905 B
PHP
Raw Normal View History

2018-11-15 10:45:49 +00:00
<?php
namespace App\Providers;
2021-11-26 13:36:57 +00:00
use Illuminate\Notifications\ChannelManager;
use Illuminate\Support\Facades\Notification;
2018-11-15 10:45:49 +00:00
use Illuminate\Support\ServiceProvider;
use App\Notifications\Channels\{EchomailChannel,NetmailChannel};
use App\Models\{Echomail,Netmail};
use App\Traits\SingleOrFail;
2018-11-15 10:45:49 +00:00
class AppServiceProvider extends ServiceProvider
{
use SingleOrFail;
/**
* Register any application services.
*
* @return void
*/
public function register()
{
2021-11-26 13:36:57 +00:00
Notification::resolved(function (ChannelManager $service) {
$service->extend('echomail', function ($app) {
return new EchomailChannel($app->make(Echomail::class));
});
2021-11-26 13:36:57 +00:00
$service->extend('netmail', function ($app) {
return new NetmailChannel($app->make(Netmail::class));
});
});
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
static::bootSingleOrFail();
}
2018-11-15 10:45:49 +00:00
}