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.

36 lines
772 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 Illuminate\Notifications\ChannelManager;
  5. use Illuminate\Support\Facades\Notification;
  6. use Illuminate\Support\ServiceProvider;
  7. use GuzzleHttp\Client as HttpClient;
  8. class AppServiceProvider extends ServiceProvider
  9. {
  10. /**
  11. * Register any application services.
  12. *
  13. * @return void
  14. */
  15. public function register()
  16. {
  17. Notification::resolved(function (ChannelManager $service) {
  18. $service->extend('fcm', function ($app) {
  19. return new FcmChannel(new HttpClient, config('fcm.key'));
  20. });
  21. });
  22. }
  23. /**
  24. * Bootstrap any application services.
  25. *
  26. * @return void
  27. */
  28. public function boot()
  29. {
  30. //
  31. }
  32. }