mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 10:14:03 +00:00
1.4 KiB
1.4 KiB
| title | extends | section |
|---|---|---|
| Laravel Orchid integration | _layouts.documentation | content |
Laravel Orchid
First, set up tenancy following the quickstart guide, and install Laravel Orchid.
To use Orchid both in the central and the tenant app:
– Copy the user and Orchid migrations to migrations\tenant
-
Enable [universal routes]({{ $page->link('features/universal-routes') }})
-
Add your tenant identification middleware to
config\platform.php(feel free to use a different identification middleware):'middleware' => [ 'public' => ['web', 'universal', InitializeTenancyByDomain::class], // Don't forget to import the middleware 'private' => ['web', 'platform', 'universal', InitializeTenancyByDomain::class], ], -
Add a route to
routes\platform.php:Route::screen('/', PlatformScreen::class) ->name('platform.index') ->breadcrumbs(function (Trail $trail) { return $trail->push(__('Home'), route('platform.index')); }); -
Add 'platform' middleware to your tenant routes (
routes\tenant.php):Route::middleware([ 'web', 'platform', InitializeTenancyByDomain::class, PreventAccessFromCentralDomains::class, ]);