clrghouz/app/Providers/AppServiceProvider.php

41 lines
757 B
PHP

<?php
namespace App\Providers;
use Illuminate\Notifications\ChannelManager;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\ServiceProvider;
use App\Notifications\Channels\NetmailChannel;
use App\Models\Netmail;
use App\Traits\SingleOrFail;
class AppServiceProvider extends ServiceProvider
{
use SingleOrFail;
/**
* Register any application services.
*
* @return void
*/
public function register()
{
Notification::resolved(function (ChannelManager $service) {
$service->extend('netmail', function ($app) {
return new NetmailChannel($app->make(Netmail::class));
});
});
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
static::bootSingleOrFail();
}
}