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.

40 lines
957 B

4 years ago
4 years ago
4 years ago
4 years ago
  1. <?php
  2. namespace App\Providers;
  3. use App\Channels\FcmChannel;
  4. use App\Channels\SocketChannel;
  5. use Illuminate\Notifications\ChannelManager;
  6. use Illuminate\Support\Facades\Notification;
  7. use Illuminate\Support\ServiceProvider;
  8. use GuzzleHttp\Client as HttpClient;
  9. class AppServiceProvider extends ServiceProvider
  10. {
  11. /**
  12. * Register any application services.
  13. *
  14. * @return void
  15. */
  16. public function register()
  17. {
  18. Notification::resolved(function (ChannelManager $service) {
  19. $service->extend('fcm', function ($app) {
  20. return new FcmChannel(new HttpClient, config('fcm.key'));
  21. });
  22. $service->extend('socket', function ($app) {
  23. return new SocketChannel(new HttpClient, config('socket.url'));
  24. });
  25. });
  26. }
  27. /**
  28. * Bootstrap any application services.
  29. *
  30. * @return void
  31. */
  32. public function boot()
  33. {
  34. //
  35. }
  36. }