From 25747b5c4d1572c9f7b676db53c29aaa624db254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Mali=C5=84ski?= Date: Sun, 27 Sep 2020 19:29:06 +0200 Subject: [PATCH 01/72] Update passport.blade.md (#81) I managed to get passport work with this code, not really sure if loadKeysFrom should be in boot method and if overriding passport config is proper way. --- source/docs/v3/integrations/passport.blade.md | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/source/docs/v3/integrations/passport.blade.md b/source/docs/v3/integrations/passport.blade.md index 3fb0503..ac584d7 100644 --- a/source/docs/v3/integrations/passport.blade.md +++ b/source/docs/v3/integrations/passport.blade.md @@ -22,14 +22,50 @@ To use Passport inside the tenant part of your application, you may do the follo PreventAccessFromCentralDomains::class, ]]); ``` + +- Add this to `boot` method in your `AppServiceProvider`: + + ```php + Passport::loadKeysFrom(base_path(config('passport.key_path'))); + ``` - `php artisan vendor:publish --tag=passport-migrations` & move to `database/migrations/tenant/` directory +- Create `passport.php` file in your config directory and add database connection and key path config. This makes passport use the default connection. + + ```php + [ + 'database' => [ + 'connection' => null, + ], + ], + 'key_path' => env('OAUTH_KEY_PATH', 'storage') + + ]; + ``` + +You may set the OAUTH_KEY_PATH in your .env, but by default `passport:keys` puts them in `storage/` directory + ## **Shared keys** If you want to use the same keypair for all tenants, do the following. -- Don't use `passport:install`, use just `passport:keys`. The install command creates keys & two clients. Instead of creating clients centrally, create `Client`s manually in your [tenant database seeder]({{ $page->link('configuration#seeder-params') }}). +- Don't use `passport:install`, use just `passport:keys`. The install command creates keys & two clients. Instead of creating clients centrally, create `Client`s manually in your [tenant database seeder]({{ $page->link('configuration#seeder-params') }}), like this: + + ```php + public function run() + { + $client = new ClientRepository(); + + $client->createPasswordGrantClient(null, 'Default password grant client', 'http://{{your.redirect.path}}'); + $client->createPersonalAccessClient(null, 'Default personal access client', 'http://{{your.redirect.path}}'); + } + ``` + ## **Tenant-specific keys** {#tenant-specific-keys} From 3f0d8808011a0801351892e82bb25b2e2e6f1302 Mon Sep 17 00:00:00 2001 From: Swapnil Bhavsar Date: Mon, 28 Sep 2020 17:58:04 +0530 Subject: [PATCH 02/72] Add example to use "tenant_route()" helper. (#80) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add example to use "tenant_route()" helper. * Update source/docs/v3/features/cross-domain-redirect.blade.md Co-authored-by: Samuel Štancl Co-authored-by: Samuel Štancl --- source/docs/v3/features/cross-domain-redirect.blade.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/docs/v3/features/cross-domain-redirect.blade.md b/source/docs/v3/features/cross-domain-redirect.blade.md index b5715c1..5f93e2e 100644 --- a/source/docs/v3/features/cross-domain-redirect.blade.md +++ b/source/docs/v3/features/cross-domain-redirect.blade.md @@ -12,4 +12,10 @@ Sometimes you may want to redirect the user to a specific route on a different d ```php return redirect()->route('home')->domain($domain); -``` \ No newline at end of file +``` + +You can also use the `tenant_route()` helper to redirect users to another domain. + +```php +return redirect(tenant_route($domain, 'home')); +``` From 3d648debb7e6f713b81153bbc2ab6a337ff74c5d Mon Sep 17 00:00:00 2001 From: Luca <26968185+VineVax@users.noreply.github.com> Date: Fri, 2 Oct 2020 15:48:59 +0200 Subject: [PATCH 03/72] fix typo (#89) --- source/docs/v3/introduction.blade.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/docs/v3/introduction.blade.md b/source/docs/v3/introduction.blade.md index 51c12db..b277e3b 100644 --- a/source/docs/v3/introduction.blade.md +++ b/source/docs/v3/introduction.blade.md @@ -12,7 +12,7 @@ Multi-tenancy is the ability to provide your service to multiple users (tenants) You may find this talk insightful: [https://multitenantlaravel.com/](https://multitenantlaravel.com/). Simply going through the slides will give you 80% of the value of the talk in under five minutes. -Note that if you just want to, say, scope todo tasks to the current user, there's no need to use a multi-tenancy package. Just use calls like `auth()->user()->tasks()`. This is the simplest for of multi-tenancy. +Note that if you just want to, say, scope todo tasks to the current user, there's no need to use a multi-tenancy package. Just use calls like `auth()->user()->tasks()`. This is the simplest form of multi-tenancy. This package is built around the idea that multi-tenancy usually means letting tenants have their own users which have their own resources, e.g. todo tasks. Not just users having tasks. From 01a2d0eda21b1329f4f83cc5de51f883e13b6b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Sat, 3 Oct 2020 16:09:25 +0200 Subject: [PATCH 04/72] fix broken image --- source/_partials/testimonials.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_partials/testimonials.blade.php b/source/_partials/testimonials.blade.php index 2a48321..d6901ff 100644 --- a/source/_partials/testimonials.blade.php +++ b/source/_partials/testimonials.blade.php @@ -14,7 +14,7 @@