1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 13:14:05 +00:00
This commit is contained in:
Samuel Štancl 2019-08-16 22:09:01 +02:00
commit a92690cea8
61 changed files with 51214 additions and 0 deletions

View file

@ -0,0 +1,20 @@
---
title: Middleware Configuration
description: Middleware Configuration with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
extends: _layouts.documentation
section: content
---
# Middleware Configuration {#middleware-configuration}
When a tenant route is visited and the tenant can't be identified, an exception is thrown. If you want to change this behavior, to a redirect for example, add this to your `app/Providers/AppServiceProvider.php`'s `boot()` method:
```php
// use Stancl\Tenancy\Middleware\InitializeTenancy;
$this->app->bind(InitializeTenancy::class, function ($app) {
return new InitializeTenancy(function ($exception) {
// return redirect()->route('foo');
});
});
```