diff --git a/src/resources/config/shopify-app.php b/src/resources/config/shopify-app.php index 656d4ff7..4e87a07c 100644 --- a/src/resources/config/shopify-app.php +++ b/src/resources/config/shopify-app.php @@ -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" | */ diff --git a/src/resources/routes/api.php b/src/resources/routes/api.php index 02237ff7..cfc45020 100644 --- a/src/resources/routes/api.php +++ b/src/resources/routes/api.php @@ -60,6 +60,6 @@ WebhookController::class.'@handle' ) ->middleware('auth.webhook') - ->name(Util::getShopifyConfig('route_names.webhook')); + ->name('webhook'); } }); diff --git a/src/resources/routes/shopify.php b/src/resources/routes/shopify.php index b16cbd31..e3ae6940 100644 --- a/src/resources/routes/shopify.php +++ b/src/resources/routes/shopify.php @@ -44,7 +44,7 @@ HomeController::class.'@index' ) ->middleware(['verify.shopify', 'billable']) - ->name(Util::getShopifyConfig('route_names.home')); + ->name('home'); } /* @@ -62,7 +62,7 @@ '/authenticate', AuthController::class.'@authenticate' ) - ->name(Util::getShopifyConfig('route_names.authenticate')); + ->name('authenticate'); } /* @@ -82,7 +82,7 @@ AuthController::class.'@token' ) ->middleware(['verify.shopify']) - ->name(Util::getShopifyConfig('route_names.authenticate.token')); + ->name('authenticate.token'); } /* @@ -101,7 +101,7 @@ ) ->middleware(['verify.shopify']) ->where('plan', '^([0-9]+|)$') - ->name(Util::getShopifyConfig('route_names.billing')); + ->name('billing'); } /* @@ -121,7 +121,7 @@ ) ->middleware(['verify.shopify']) ->where('plan', '^([0-9]+|)$') - ->name(Util::getShopifyConfig('route_names.billing.process')); + ->name('billing.process'); } /* @@ -140,6 +140,6 @@ BillingController::class.'@usageCharge' ) ->middleware(['verify.shopify']) - ->name(Util::getShopifyConfig('route_names.billing.usage_charge')); + ->name('billing.usage_charge'); } });