mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 11:14:04 +00:00
Fix code block formatting
This commit is contained in:
parent
48baf88bf3
commit
7ac9a4ab2c
1 changed files with 5 additions and 4 deletions
|
|
@ -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.
|
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.
|
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 = [
|
```php
|
||||||
\Stancl\Tenancy\Middleware\InitializeTenancy::class,
|
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.
|
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.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue