title: Use of undefined constant CURL_POSTFIELDS - assumed 'CURL_POSTFIELDS' (this will throw an Error in a future version of PHP)
body: <p>I'm writing a laravel application to send sms. However the postfields part is throwing an error. How do I resolve it?</p>
  
  <pre class="lang-php prettyprint-override"><code>private function sendMessage($message, $recipients) {
      $encodeMessage=urlencode($message);
      $authkey = 'XYZ';
      $senderid = '';
      $route = ;
      $country = ;
      $data = array(
          'authkey' =&gt; $authkey,
          'recipients' =&gt; $recipients,
          'message' =&gt; $encodeMessage,
          'sender' =&gt; $senderid,
          'route' =&gt; $route,
          'country' =&gt; $country,
      );
      //dd($recipients)
      $url = " ";
      $ch = curl_init();
      curl_setopt_array($ch, array(
          CURLOPT_URL =&gt; $url,
          CURLOPT_RETURNTRANSFER =&gt; true,
          CURLOPT_POST =&gt; true,
          CURL_POSTFIELDS =&gt; $data
      ));
      curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,0);
      curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,0);$output=curl_exec($ch);
      if(curl_errno($ch)) {
          echo 'error '.curl_error($ch);
      }
      curl_close($ch);
      return back()-&gt;with('success','Messages sent successfully');
  }
  </code></pre>
  
  <p>This is the error I'm getting:</p>
  
  <blockquote>
    <p>"Use of undefined constant CURL_POSTFIELDS - assumed 'CURL_POSTFIELDS'
    (this will throw an Error in a future version of PHP)"</p>
  </blockquote>