tenancy-docs/source/docs/v2/nova.blade.md
Samuel Štancl f8f354c323 3.x redesign
2020-06-08 21:20:15 +02:00

1.2 KiB

title description extends section
Nova Integration Nova Integration _layouts.documentation content

Nova Integration

To use Nova inside of the tenant part of your application, do the following:

  • Publish the Nova migrations and move them to the database/migrations/tenant directory.
    php artisan vendor:publish --tag=nova-migrations
    
  • 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('universal-routes') }}) of the app.)
  • Add the 'tenancy' middleware group to your nova.middleware config. Example:
    'middleware' => [
        'tenancy',
        'web',
        Authenticate::class,
        DispatchServingNovaEvent::class,
        BootTools::class,
        Authorize::class,
    ],
    
  • In your NovaServiceProvider's routes() method, replace the following lines:
    ->withAuthenticationRoutes()
    ->withPasswordResetRoutes()
    
    with these lines:
    ->withAuthenticationRoutes(['web', 'tenancy'])
    ->withPasswordResetRoutes(['web', 'tenancy'])