Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making routes bypass the tenant middleware #41

Closed
rvzug opened this issue Feb 24, 2021 · 1 comment
Closed

Making routes bypass the tenant middleware #41

rvzug opened this issue Feb 24, 2021 · 1 comment

Comments

@rvzug
Copy link

rvzug commented Feb 24, 2021

Hi,
What is the best approach to bypass the tenant middlewares?

Available for tenants (backoffice) ==> tenant.auth
tenant.domain.com/
tenant.domain.com/dashboard
tenant.domain.com/products/add

Available for customers of tenants ==> tenant.guest
tenant.domain.com/form-to-some-guest-logic

Available for everyone without a scope/tenant middleware
domain.com/
domain.com/register (logic to let visitors create themself as tenant)

==> This doesn't workt at this moment. As soon as I define a Route::get('/', ...) all visitors, subdomain or not will return to the domain.com/ endpoint. And it should deffer based on when there is an tenant-subdomain or not.

@Naoray
Copy link
Contributor

Naoray commented Feb 25, 2021

How does your routes file look like? You should be able to bypass any tenant middleware by defining the route outside of the route group you apply the middleware on.

Route::middleware('tenant.auth')->group(function () {
    // all tenant auth routes
});


Route::middleware('tenant.guest')->group(function () {
    // all tenant guest routes
});

// all non tenant related routes
Route::get('/register', ...);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants