<?php
$fcmToken = ['cFlXEwr4Y07ikw14-QuIHJ:APA91bE54mrOpFyzDSq7NfFnYqPXrA2B4mXrqFYlxaVphIsFvHiMEt4lHypW-IYmfZT1F41c-3ke-7rtDZSI_RVsioIkk2krlr4DSZrY1cor2hz2TBo9CJoleriKeB8OzxLzDxhjqj2L'];
$title = "Test Push notification";
$body = "This is test Push notification";
 $url = 'https://f...content-available-to-author-only...s.com/fcm/send';
         // $serverKey = env('FCM_SERVER_KEY');
         $serverKey = "AAAAmgAHb2U:APA91bGbQXS7Ptwo7gvFXqp0I11z9SbUslgOm62co6TPd4BuxY2NDUkAawNR6l4r9j69A7wVJldgxPe2y5tSzbFNl-lD8kdqeNgzT8vus5vRa8s956d_7VYO6sCVqyIS0ctEj0rIJSc1";
         $data = [
            "registration_ids" => $fcmToken,
            "notification" => [
               "title" => $title,
               "body" => $body,
            ]
         ];
         $encodedData = json_encode($data);
         $headers = [
            'Authorization:key=' . $serverKey,
            'Content-Type: application/json',
         ];
         $ch = curl_init();

         curl_setopt($ch, CURLOPT_URL, $url);
         curl_setopt($ch, CURLOPT_POST, true);
         curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
         curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
         // Disabling SSL Certificate support temporarly
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
         curl_setopt($ch, CURLOPT_POSTFIELDS, $encodedData);
         // Execute post
         $result = curl_exec($ch);
         echo $result ? "results" : "false";
         if ($result === FALSE) {
            echo "false output";
            return false;
         }
         // Close connection
         curl_close($ch);
         // FCM response
         return true;
      ?>