HTTP_X_SHOPIFY_HMAC_SHA256 error in Laravel

Shopify Expert
11 0 1

I ma trying to set up an api that works off a webhook. I have set up the webhook in shopify and then in the laravel controller I have added the php code as per the shopify doc s


Problem is I keep getting an error: 

(1/1) ErrorException

Undefined index: HTTP_X_SHOPIFY_HMAC_SHA256

Any help greatly appreciated

Replies 4 (4)
Shopify Staff
Shopify Staff
1561 81 321

Hey Barry,

On an absolutely basic level I can't replicate this behaviour. With some logging set up for a standard webhook posts route, I'm finding the index just fine in webhook request header arrays:

Route::post('/webhooks', function()

If I had to guess, maybe the shift in context from route to controller is where the values of $_SERVER are being lost?


Alex | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Shopify Expert
11 0 1

I Managed to get this working by having the verification in a controller and routing to the controller, but it had to be in the construct, wouldnt work in the index method

New Member
1 0 0

How did you solve this? I am also facing the same problem. I am trying to recieve data from a webhook in Laravel. When I fire it to a route in Laravel and add the verify code into the route nothing happens. I also checked this:

This didn't work for me. Can you just tell me how did you included the PHP code in the controller and what modification you made in the routes?

New Member
6 0 0

@javedali Hey my friend how are you ?

Have you fix this problem ? if so, how did you do it?
I am facing the same problem...

Thank you my friend