From 703f7b037b6aee468c2e9e20c2e8c0da133f905c Mon Sep 17 00:00:00 2001 From: Impeck Date: Mon, 11 Apr 2022 16:21:08 +0500 Subject: [PATCH 1/2] For Orchid add the path to the "home" route for central app (#159) * add Laravel Orchid integration * add the path to the "home" route for central application * fix link to Universal Routes --- source/docs/v3/integrations/orchid.blade.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/source/docs/v3/integrations/orchid.blade.md b/source/docs/v3/integrations/orchid.blade.md index 0637898..0e2aec1 100644 --- a/source/docs/v3/integrations/orchid.blade.md +++ b/source/docs/v3/integrations/orchid.blade.md @@ -5,21 +5,25 @@ section: content --- # Laravel Orchid {#laravel-orchid} + The instruction is written for a newly installed Orchid platform, it is proposed to use the platform as a central application and the tenant app. ## Both in the central app and the tenant app Laravel Orchid has already been installed according to the [documentation Orchid](https://orchid.software/en/docs/installation/). All the steps have also been completed [Quickstart Tutorial](/docs/v3/quickstart). -- To use Orchid both in the central & tenant parts you need to enable [Universal Routes](docs/v3/features/universal-routes). +- To use Orchid both in the central & tenant parts you need to enable [Universal Routes]({{ $page->link('features/universal-routes') }}). - Add the tenancy middleware to your `config\platform.php` + ```php 'middleware' => [ 'public' => ['web', 'universal', \Stancl\Tenancy\Middleware\InitializeTenancyByDomain::class], 'private' => ['web', 'platform', 'universal', \Stancl\Tenancy\Middleware\InitializeTenancyByDomain::class], ], ``` + - Add a route to `routes\platform.php` + ```php Route::screen('/', PlatformScreen::class) ->name('platform.index') @@ -27,16 +31,24 @@ Laravel Orchid has already been installed according to the [documentation Orchid return $trail->push(__('Home'), route('platform.index')); }); ``` + +- In the file `app\Providers\RouteServiceProvider.php`, if necessary, change the path to the "home" route for your central application. By default for Orchid it will be `'admin/main'` + + ```php + public const HOME = 'admin/main'; + ``` + - Tenant Routes `routes\tenant.php` + ```php Route::middleware([ 'web', 'platform', InitializeTenancyByDomain::class, PreventAccessFromCentralDomains::class, - ])->prefix('admin')->group(function () { + ])->prefix(Orchid\Platform\Dashboard::prefix('/'))->group(function () { Route::get('/', function () { return 'This is your multi-tenant application. The id of the current tenant is ' . tenant('id'); }); }); - ``` \ No newline at end of file + ``` From 88f58d3907f8db0fdb4cc74ef11e134d25e5bb32 Mon Sep 17 00:00:00 2001 From: Ahmed Sayed Date: Wed, 20 Apr 2022 16:30:44 +0200 Subject: [PATCH 2/2] fix typo (#163) --- source/docs/v3/features/tenant-config.blade.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/docs/v3/features/tenant-config.blade.md b/source/docs/v3/features/tenant-config.blade.md index 3d2432f..21e3bc8 100644 --- a/source/docs/v3/features/tenant-config.blade.md +++ b/source/docs/v3/features/tenant-config.blade.md @@ -30,7 +30,7 @@ For example, if your `$storageToConfigMap` looked like this: ```php \Stancl\Tenancy\Features\TenantConfig::$storageToConfigMap = [ 'paypal_api_key' => 'services.paypal.api_key', -], +]; ``` the value of `paypal_api_key` in tenant model would be copied to the `services.paypal.api_key` config when tenancy is initialized. @@ -45,5 +45,5 @@ Sometimes you may want to copy the value to multiple config keys. To do that, sp 'app.locale', 'locales.default', ], -], +]; ```