From 388d21bb464efa1659a7da5b7ce511f275242365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Thu, 17 Oct 2019 21:06:48 +0200 Subject: [PATCH] [2.1.0] Nova integration (#29) * [2.1.0] Nova integration * Add nav link to Nova integration * Note about nova migrations --- docs/navigation.php | 1 + docs/source/v2/nova.blade.md | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 docs/source/v2/nova.blade.md diff --git a/docs/navigation.php b/docs/navigation.php index 22de36c..236daef 100644 --- a/docs/navigation.php +++ b/docs/navigation.php @@ -96,6 +96,7 @@ return [ 'children' => [ 'Spatie Packages' => 'spatie', 'Horizon' => 'horizon', + 'Nova' => 'nova', 'Telescope' => 'telescope', ], ], diff --git a/docs/source/v2/nova.blade.md b/docs/source/v2/nova.blade.md new file mode 100644 index 0000000..78a0bc6 --- /dev/null +++ b/docs/source/v2/nova.blade.md @@ -0,0 +1,36 @@ +--- +title: Nova Integration +description: Nova Integration +extends: _layouts.documentation +section: content +--- + +# Nova Integration {#nova-integration} + +To make Nova part of your tenant application, do the following: +- Publish the Nova migrations and move them to the `database/migrations/tenant` directory. + ```none + php artisan vendor:publish --tag=nova-migrations + ``` + > Note: Unfortunately, Nova will still be adding its migrations to your central migrations. This is something we'd like to solve in the future. +- Add the `'tenancy'` middleware group to your `nova.middleware` config. Example: + ```php + 'middleware' => [ + 'tenancy', + 'web', + Authenticate::class, + DispatchServingNovaEvent::class, + BootTools::class, + Authorize::class, + ], + ``` +- In your `NovaServiceProvider`'s `routes()` method, replace the following lines: + ```php + ->withAuthenticationRoutes() + ->withPasswordResetRoutes() + ``` + with these lines: + ```php + ->withAuthenticationRoutes(['web', 'tenancy']) + ->withPasswordResetRoutes(['web', 'tenancy']) + ```