You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

53 lines
1.4 KiB

<?php
namespace App\Providers;
use App\Channels\DBChannel;
use App\Channels\FcmChannel;
use App\Channels\SmsChannel;
use App\Channels\SocketChannel;
use Illuminate\Notifications\ChannelManager;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\ServiceProvider;
use GuzzleHttp\Client as HttpClient;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
Notification::resolved(function (ChannelManager $service) {
$service->extend('fcm', function ($app) {
return new FcmChannel(new HttpClient, config('fcm.key'));
});
$service->extend('socket', function ($app) {
return new SocketChannel(new HttpClient, config('socket.url'));
});
// $service->extend('db', function ($app) {
// return new DBChannel();
// });
$service->extend('sms', function ($app) {
return new SmsChannel(
new HttpClient,
config('smsirlaravel.webservice-url'),
config('smsirlaravel.api-key'),
config('smsirlaravel.secret-key'),
);
});
});
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
//
}
}