1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 14:54:04 +00:00

Fix code block formatting

This commit is contained in:
Samuel Štancl 2019-01-20 17:35:02 +01:00
parent 48baf88bf3
commit 7ac9a4ab2c

View file

@ -25,10 +25,11 @@ composer require stancl/tenancy
The `TenancyServiceProvider` automatically adds the `tenancy` middleware group which can be assigned to routes. You only need to make sure the middleware is top priority.
Open `app/Http/Kernel.php` and make the middleware top priority, so that it gets executed before anything else, making sure things like the database switch connections soon enough.
```php
protected $middlewarePriority = [
\Stancl\Tenancy\Middleware\InitializeTenancy::class,
```
```php
protected $middlewarePriority = [
\Stancl\Tenancy\Middleware\InitializeTenancy::class,
```
When a tenant route is visited, but 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.