title: laravel verify shopify webhook
body: <p>How can I verify my shopify webhooks in laravel?
  Currently I'm doing the following:</p>
  
  <pre><code>//Validate secret 
      if ( Request::header( 'X-Shopify-Hmac-Sha256' ) ) {
          $hmac_header = Request::header( 'X-Shopify-Hmac-Sha256' );
          $data = Request::json();
          $calculated_hmac = base64_encode( hash_hmac( 'sha256', $data, Config::get( 'constants.SHOPIFY_APP_SECRET' ), true ) );
          if ( $hmac_header != $calculated_hmac ) {
              return Response::json( array(
                      'error' =&gt; true,
                      'message' =&gt; "invalid secret" ),
                  403 );
          }
      }else {
          return Response::json( array(
                  'error' =&gt; true,
                  'message' =&gt; "no secret" ),
              403 );
      }
  </code></pre>
  
  <p>But it fails with the following message:</p>
  
  <pre><code>#0 [internal function]: Illuminate\Exception\Handler-&gt;handleError(2, 'hash_hmac() exp...', '/Users/JS/Sites...', 58, Array)
  #1 /Users/JS/Sites/xxx/api/app/controllers/CustomerController.php(58): hash_hmac('sha256', Object(Symfony\Component\HttpFoundation\ParameterBag), 'xxxxxxxxxx...', true)
  </code></pre>
  
  <p>I suspect it has sth to do with the way I get the request data: </p>
  
  <pre><code>$data = Request::json();
  </code></pre>
  
  <p>Does anyone have a solution? Thx!</p>