mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 10:14:03 +00:00
New routes
This commit is contained in:
parent
478452d1eb
commit
ae63f30be6
68 changed files with 346 additions and 215 deletions
20
docs/source/v2/middleware-configuration.blade.md
Normal file
20
docs/source/v2/middleware-configuration.blade.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
title: Middleware Configuration
|
||||
description: Middleware Configuration..
|
||||
extends: _layouts.documentation_v2
|
||||
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');
|
||||
});
|
||||
});
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue