This commit is contained in:
Samuel Štancl 2020-08-01 22:15:45 +02:00
parent e7a532a162
commit 447f22ba56

View file

@ -10,7 +10,7 @@ section: content
If you wish to use Laravel Nova in the central application (to manage tenants), you need to make a small change to the Nova migrations, they expect your model primary keys to always be unsigned big integers, but your tenants might be using `string` ids. If you wish to use Laravel Nova in the central application (to manage tenants), you need to make a small change to the Nova migrations, they expect your model primary keys to always be unsigned big integers, but your tenants might be using `string` ids.
You can find the full Nova setup for managing tenants in the [SaaS boilerplate](/saas-boilerplate): You can find the full Nova setup for managing tenants in the [SaaS boilerplate](/saas-boilerplate). It also implements Nova for **both the central and tenant parts of the app, with separate resources**.
## In the tenant app {#in-the-tenant-app} ## In the tenant app {#in-the-tenant-app}
@ -24,7 +24,6 @@ To use Nova inside of the tenant part of your application, do the following:
- Prevent Nova from adding its migrations to your central migrations by adding `Nova::ignoreMigrations()` to `NovaServiceProvider::boot()` (Don't do this if you want to use Nova **[both in the central & tenant parts]({{ $page->link('features/universal-routes') }})** of the app.) - Prevent Nova from adding its migrations to your central migrations by adding `Nova::ignoreMigrations()` to `NovaServiceProvider::boot()` (Don't do this if you want to use Nova **[both in the central & tenant parts]({{ $page->link('features/universal-routes') }})** of the app.)
- Add the tenancy middleware to your `nova.middleware` config. Example: - Add the tenancy middleware to your `nova.middleware` config. Example:
```php ```php
'middleware' => [ 'middleware' => [
// You can make this simpler by creating a tenancy route group // You can make this simpler by creating a tenancy route group
@ -37,7 +36,6 @@ To use Nova inside of the tenant part of your application, do the following:
Authorize::class, Authorize::class,
], ],
``` ```
- In your `NovaServiceProvider`'s `routes()` method, replace the following lines: - In your `NovaServiceProvider`'s `routes()` method, replace the following lines:
```php ```php
@ -60,4 +58,5 @@ To use Nova inside of the tenant part of your application, do the following:
PreventAccessFromCentralDomains::class, PreventAccessFromCentralDomains::class,
'web', 'web',
]) ])
``` ```
- Set the `domain` in Nova config to `null`