Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

joneyspark's avatar

How to solve x-frame-options' to 'sameorigin' in Laravel Shopify App

I'm using the Larvel Shopify package to make a Shopify app with Laravel all setup is done but I faced a problem that' I can't solve. Please help me. here is the package link

https://github.com/osiset/laravel-shopify/wiki/Installation

0 likes
8 replies
joneyspark's avatar

where I get Nginx configuration: ??

add_header X-Frame-Options "SAMEORIGIN";

I'm using Apache server

joneyspark's avatar

<IfModule mod_headers.c> Header unset X-Frame-Options "SAMEORIGIN" </IfModule>

This working for me it needs to unset in .htaccess file

Thanks to all

BigAvocado's avatar

@joneyspark Thank you very much for sharing it’s very useful article and hope to read more about your experience.

abdulrehman25's avatar

This is what worked for me adding the following in .htaccess

<IfModule mod_headers.c> Header set X-Frame-Options ALLOW </IfModule>

jongore's avatar

Follow the below steps to allow embedding a Laravel Shopify app within an iframe and solve the 'x-frame-options' issue:

1- Open the AppServiceProvider.php file in the app/Providers directory. 2- Add code in the boot method to modify the response headers. 3- Save and close the file. 4- Open the Authenticate.php middleware file in the app/Http/Middleware directory. 5- Add a line in the handle method to set the frame options header. 6- Save and close the file. 7- The changes will enable embedding the app in an iframe by adding the 'X-Frame-Options' header.

Please or to participate in this conversation.