From 59524159b604bc627bfafb9c552d8f5add53f44d Mon Sep 17 00:00:00 2001 From: Tb Fajri Date: Fri, 24 May 2024 09:43:20 +0700 Subject: [PATCH] update package fcm --- app/Notifications/SendNotification.php | 2 +- config/app.php | 5 +++++ config/services.php | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/Notifications/SendNotification.php b/app/Notifications/SendNotification.php index ea9ca6d0..4473a915 100644 --- a/app/Notifications/SendNotification.php +++ b/app/Notifications/SendNotification.php @@ -30,7 +30,7 @@ class SendNotification extends Notification public function toFcm($notifiable) { return FcmMessage::create() - ->setData($this->data) // Menggunakan $this->data + ->setData($this->data) ->setNotification([ 'title' => $this->title, 'body' => $this->body, diff --git a/config/app.php b/config/app.php index 906288da..a7e64d95 100644 --- a/config/app.php +++ b/config/app.php @@ -202,6 +202,11 @@ return [ App\Providers\EventServiceProvider::class, App\Providers\RouteServiceProvider::class, + /** + * Package Firebase Cloud Message + */ + NotificationChannels\Fcm\FcmServiceProvider::class, + ], /* diff --git a/config/services.php b/config/services.php index e1904897..bcf1a378 100644 --- a/config/services.php +++ b/config/services.php @@ -37,4 +37,9 @@ return [ 'redirect' => env('GOOGLE_REDIRECT_URI'), ], + 'fcm' => [ + 'key' => env('FCM_SERVER_KEY'), + 'sender_id' => env('FCM_SENDER_ID'), + ], + ];