The issue is when you have other subdomains such as nova.domain.test, the root path will still show the original website and not changing to the Nova Admin panel. The second case is when the subdomain, in my case luxury.domain.test, it loads the other layout but the routes won't map correctly. Let me be more clear.
everything works fine but not the translated routes. When trying to access a translated subdomain it gives a 'route is null' or not defined.
However, in the second scenario if I remove the above code, the translated subdomains are working as intended, but the other two subdomains are behaving differently.
nova.domain.test when accessed at the root path it will still show the original website.
luxury.domain.test when accessed at the root path it will show the correct website, but the other routes will be mapped using this domain.
Example:
If I have the following route under the root domain:
When used under the subdomain luxury.domain.test as
{{ route('contact.index') }}
It will map to luxury.domain.test/contact instead of domain.test/contact.
However, every route for nova still works fine once you reach the dashboard by manually typing nova.domain.test/dashboard or any other route.
Introduction
The issue is when you have other subdomains such as nova.domain.test, the root path will still show the original website and not changing to the Nova Admin panel. The second case is when the subdomain, in my case luxury.domain.test, it loads the other layout but the routes won't map correctly. Let me be more clear.
Setup
I have the following subdomains:
The .env values are the following:
The routes within the luxury package are wrapped in this way:
and for nova, I have set the following values in the config:
and .env file
Describing Issue
Now, I have two scenarios.
If I wrap my default routes within the web.php like this
everything works fine but not the translated routes. When trying to access a translated subdomain it gives a 'route is null' or not defined.
However, in the second scenario if I remove the above code, the translated subdomains are working as intended, but the other two subdomains are behaving differently.
When used under the subdomain
luxury.domain.test
asIt will map to
luxury.domain.test/contact
instead ofdomain.test/contact
. However, every route for nova still works fine once you reach the dashboard by manually typingnova.domain.test/dashboard
or any other route.