How to Separate Admin Panel and API Domains in a Multi-Tenant Laravel Nova App integrated by stancl/tenancy #6895
Unanswered
BehroozBvk
asked this question in
Ideas & Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm using the following packages in my multi-tenant Laravel project:
stancl/tenancy:^3.9.1
laravel/nova:^5.0
I want to separate the domains used for the admin panel and for API access. Specifically:
Admin panel should be accessible like this:
API endpoints should be accessible through a different domain:
And I want to make sure that the APIs are not accessible via the admin domain (
example.com
) and vice versa.What I've tried so far:
I temporarily solved this requirement using the following approach, but it's not ideal — both domains (
example.com
andexample-api.com
) can still access each other’s routes, which violates my intended separation.central_domains
section ofconfig/tenancy.php
:config/nova.php
middleware to:routes/api.php
:Problem:
Despite this setup, both the admin panel and API are accessible from either domain (
example.com
andexample-api.com
). I want a strict separation between them.Question:
How can I strictly isolate the admin panel (
example.com
) from the API routes (example-api.com
) so that each domain only serves its intended purpose?Any suggestions or recommended practices would be greatly appreciated.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions