Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions src/resources/config/shopify-app.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,31 @@

/*
|--------------------------------------------------------------------------
| Route names
| Route Names
|--------------------------------------------------------------------------
|
| This option allows you to override the package's built-in route names.
| This can help you avoid collisions with your existing route names.
| These route names are used when registering the package’s internal routes.
| You may override any of them if your application needs to take control
| of a specific route.
|
| ⚠️ Important (Laravel >= v12.29.0)
| Laravel now gives precedence to the FIRST route registered with the
| same name. Since package service providers are typically booted BEFORE
| the application's RouteServiceProvider, package routes will be
| registered first.
|
| Result:
| - If both your application and this package define the same route name,
| the PACKAGE route will take precedence — your application route
| will be ignored.
|
| Recommendation:
| If you want your application to override a route, change the route name
| here (or via environment variables) and reference that name within your
| application’s route definition.
|
| Example:
| SHOPIFY_ROUTE_NAME_HOME="my.custom.home"
|
*/

Expand Down
2 changes: 1 addition & 1 deletion src/resources/routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@
WebhookController::class.'@handle'
)
->middleware('auth.webhook')
->name(Util::getShopifyConfig('route_names.webhook'));
->name('webhook');
}
});
12 changes: 6 additions & 6 deletions src/resources/routes/shopify.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
HomeController::class.'@index'
)
->middleware(['verify.shopify', 'billable'])
->name(Util::getShopifyConfig('route_names.home'));
->name('home');
}

/*
Expand All @@ -62,7 +62,7 @@
'/authenticate',
AuthController::class.'@authenticate'
)
->name(Util::getShopifyConfig('route_names.authenticate'));
->name('authenticate');
}

/*
Expand All @@ -82,7 +82,7 @@
AuthController::class.'@token'
)
->middleware(['verify.shopify'])
->name(Util::getShopifyConfig('route_names.authenticate.token'));
->name('authenticate.token');
}

/*
Expand All @@ -101,7 +101,7 @@
)
->middleware(['verify.shopify'])
->where('plan', '^([0-9]+|)$')
->name(Util::getShopifyConfig('route_names.billing'));
->name('billing');
}

/*
Expand All @@ -121,7 +121,7 @@
)
->middleware(['verify.shopify'])
->where('plan', '^([0-9]+|)$')
->name(Util::getShopifyConfig('route_names.billing.process'));
->name('billing.process');
}

/*
Expand All @@ -140,6 +140,6 @@
BillingController::class.'@usageCharge'
)
->middleware(['verify.shopify'])
->name(Util::getShopifyConfig('route_names.billing.usage_charge'));
->name('billing.usage_charge');
}
});
Loading