mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 18:24:03 +00:00
parent
ba394c38cc
commit
3d8c61b2fe
3 changed files with 49 additions and 34 deletions
|
|
@ -77,6 +77,7 @@ return [
|
||||||
'url' => 'digging-deeper',
|
'url' => 'digging-deeper',
|
||||||
'children' => [
|
'children' => [
|
||||||
'Tenants' => 'tenants',
|
'Tenants' => 'tenants',
|
||||||
|
'Central App' => 'central-app',
|
||||||
'Tenant Config' => 'tenant-config',
|
'Tenant Config' => 'tenant-config',
|
||||||
'Middleware Configuration' => 'middleware-configuration',
|
'Middleware Configuration' => 'middleware-configuration',
|
||||||
'Custom Database Names' => 'custom-database-names',
|
'Custom Database Names' => 'custom-database-names',
|
||||||
|
|
@ -101,7 +102,6 @@ return [
|
||||||
'children' => [
|
'children' => [
|
||||||
'HTTPS Certificates' => 'https-certificates',
|
'HTTPS Certificates' => 'https-certificates',
|
||||||
'Misc' => 'misc-tips',
|
'Misc' => 'misc-tips',
|
||||||
'Global Cache/Storage/...' => 'global-stuff',
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'Stay Updated' => 'stay-updated',
|
'Stay Updated' => 'stay-updated',
|
||||||
|
|
|
||||||
48
docs/source/v2/central-app.blade.md
Normal file
48
docs/source/v2/central-app.blade.md
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
---
|
||||||
|
title: Central App
|
||||||
|
description: Central App
|
||||||
|
extends: _layouts.documentation
|
||||||
|
section: content
|
||||||
|
---
|
||||||
|
|
||||||
|
# Central App {#central-app}
|
||||||
|
|
||||||
|
This package uses routes to separate the tenant part of the application from the central part of the application. The central part will commonly include a landing page, sign up form, and some sort of dashboard.
|
||||||
|
|
||||||
|
## Central routes {#central-routes}
|
||||||
|
|
||||||
|
Routes in the `routes/web.php` file are the central routes. When they are visited, tenancy is *not* intialized and any model, cache call, controller, job dispatch, Redis call and anything else that is called in during this request will be central.
|
||||||
|
|
||||||
|
## Central domains {#central-domains}
|
||||||
|
|
||||||
|
However, since you don't want routes related to the app on your main domain and sign up forms on tenant domains, you must also define what domains host the central stuff in the `tenancy.exempt_domains` config.
|
||||||
|
|
||||||
|
## Using central things inside the tenant app {#using-central-things-inside-the-tenant-app}
|
||||||
|
|
||||||
|
To use central things (databases/caches/Redis connections/filesystems/...) on special places of your tenant app, you may do the following.
|
||||||
|
|
||||||
|
### Central database {#central-database}
|
||||||
|
|
||||||
|
Create a new connection and use it like `DB::connection($connectionName)->table('foo')->where(...)`
|
||||||
|
|
||||||
|
If you want to use models, create a `getConnectionName()` method that returns the name of the central connection
|
||||||
|
|
||||||
|
### Central redis {#central-redis}
|
||||||
|
|
||||||
|
Create a new connection, *don't* put it into `tenancy.redis.prefixed_connections`, and use it like `Redis::connection('foo')->get('bar')`
|
||||||
|
|
||||||
|
### Central cache {#central-cache}
|
||||||
|
|
||||||
|
Use the `GlobalCache` facade, or the `global_cache()` helper.
|
||||||
|
|
||||||
|
### Central storage {#central-storage}
|
||||||
|
|
||||||
|
Create a disk and *don't* add it to `tenancy.filesystem.disks`.
|
||||||
|
|
||||||
|
### Central assets {#central-assets}
|
||||||
|
|
||||||
|
Use the `global_asset()` helper.
|
||||||
|
|
||||||
|
### Central queues {#central-queues}
|
||||||
|
|
||||||
|
Coming soon.
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
---
|
|
||||||
title: Global Cache/Storage/Assets/...
|
|
||||||
description: Global Cache/Storage/Assets/...
|
|
||||||
extends: _layouts.documentation
|
|
||||||
section: content
|
|
||||||
---
|
|
||||||
|
|
||||||
# Global Cache/Storage/Assets/...
|
|
||||||
|
|
||||||
## Global Cache {#global-cache}
|
|
||||||
|
|
||||||
Use the `GlobalCache` facade, or the `global_cache()` helper.
|
|
||||||
|
|
||||||
## Global Storage {#global-storage}
|
|
||||||
|
|
||||||
Create a disk and *don't* add it to `tenancy.filesystem.disks`.
|
|
||||||
|
|
||||||
## Global Assets {#global-assets}
|
|
||||||
|
|
||||||
Use the `global_asset()` helper.
|
|
||||||
|
|
||||||
## Global Database {#global-database}
|
|
||||||
|
|
||||||
Create a new connection and use it like `DB::connection($connectionName)->table('foo')->where(...)`
|
|
||||||
|
|
||||||
## Global Redis {#global-redis}
|
|
||||||
|
|
||||||
Create a new connection, *don't* put it into `tenancy.redis.prefixed_connections`, and use it like `Redis::connection('foo')->get('bar')`
|
|
||||||
|
|
||||||
## Global Queues/Jobs {#global-queues-jobs}
|
|
||||||
|
|
||||||
Coming soon.
|
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue