Skip to content

Commit be2b1d9

Browse files
Add subdomain support (#318)
* Update shopify-app.php * Update shopify.php * Update api.php Add subdomain --------- Co-authored-by: Luke Walsh <[email protected]>
1 parent 1cc5029 commit be2b1d9

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

src/resources/config/shopify-app.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@
2525

2626
'manual_migrations' => (bool) env('SHOPIFY_MANUAL_MIGRATIONS', false),
2727

28+
/*
29+
|--------------------------------------------------------------------------
30+
| Sub Domain
31+
|--------------------------------------------------------------------------
32+
|
33+
| This is the subdomain where Shopify will be accessible from. If the
34+
| setting is null, Shopify will reside under the same domain as the
35+
| application. Otherwise, this value will be used as the subdomain.
36+
|
37+
*/
38+
39+
'domain' => env('SHOPIFY_DOMAIN'),
40+
2841
/*
2942
|--------------------------------------------------------------------------
3043
| Manual routes

src/resources/routes/api.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
$manualRoutes = explode(',', $manualRoutes);
1414
}
1515

16-
Route::group(['middleware' => ['api']], function () use ($manualRoutes) {
16+
Route::group([
17+
'domain' => Util::getShopifyConfig('domain'),
18+
'middleware' => ['api']
19+
], function () use ($manualRoutes) {
1720
/*
1821
|--------------------------------------------------------------------------
1922
| API Routes

src/resources/routes/shopify.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
$manualRoutes = explode(',', $manualRoutes);
2424
}
2525

26-
Route::group(['prefix' => Util::getShopifyConfig('prefix'), 'middleware' => ['web']], function () use ($manualRoutes) {
26+
Route::group([
27+
'domain' => Util::getShopifyConfig('domain'),
28+
'prefix' => Util::getShopifyConfig('prefix'),
29+
'middleware' => ['web']
30+
], function () use ($manualRoutes) {
2731
/*
2832
|--------------------------------------------------------------------------
2933
| Home Route

0 commit comments

Comments
 (0)