-
-
Notifications
You must be signed in to change notification settings - Fork 485
Description
Bug description
I have a fresh Laravel app using the React starter kit, which comes with laravel/vite-plugin-wayfinder installed and configured, which is a Vite plugin for Wayfinder.
One of the things that Wayfiner does is generate importable TypeScript functions for routes, so in TypeScript, instead of doing something like href="/dashboard" we will be able to do href={dashboard()}.
It uses the name of the Laravel route to generate the TypeScript function, which is fine, but with the Tennancy for Laravel package installed, and as it is mentioned in the docs, we should add this to the web.php file:
foreach (config('tenancy.central_domains') as $domain) {
Route::domain($domain)->group(function () {
// your actual routes
});
}This will generate multiple routes with the same name (because we may have multiple central domains), and Wayfinder will create multiple exports with the same name, which is not possible in JavaScript:
Steps to reproduce
- Create a new Laravel app and use the React starter kit.
- Install Tenancy for Laravel by following the Quickstart Tutorial.
php artisan serveandnpm run devand visit the home page.
Expected behavior
Wayfinder should not create multiple exports with the same name.
Laravel version
12.44.0
stancl/tenancy version
3.9