diff --git a/dist/index.html b/dist/index.html
index abb15c1..d3b4b98 100644
--- a/dist/index.html
+++ b/dist/index.html
@@ -78,9 +78,9 @@
+ src="https://travis-ci.com/stancl/tenancy.svg?branch=2.x" alt="Travis CI build">
+ src="https://codecov.io/gh/stancl/tenancy/branch/2.x/graph/badge.svg" alt="codecov">
diff --git a/docs/config.php b/docs/config.php
index e278660..49762dc 100644
--- a/docs/config.php
+++ b/docs/config.php
@@ -8,10 +8,10 @@ return [
// key => display name
'versions' => [
- '1.x' => '1.x',
- '2.x' => '2.x (beta)',
+ 'v1' => '1.x',
+ 'v2' => '2.x (beta)',
],
- 'defaultVersion' => '1.x',
+ 'defaultVersion' => 'v1',
'prettyUrls' => true,
'version' => function ($page) {
diff --git a/docs/navigation.php b/docs/navigation.php
index 6f683c4..8ff376a 100644
--- a/docs/navigation.php
+++ b/docs/navigation.php
@@ -1,7 +1,7 @@
[
+ 'v1' => [
'Getting Started' => [
'url' => 'getting-started',
'children' => [
@@ -51,7 +51,7 @@ return [
'Stay Updated' => 'stay-updated',
'GitHub' => 'https://github.com/stancl/tenancy',
],
- '2.x' => [
+ 'v2' => [
'Getting Started' => [
'url' => 'getting-started',
'children' => [
diff --git a/docs/source/2.x/digging-deeper.blade.md b/docs/source/2.x/digging-deeper.blade.md
deleted file mode 100644
index bef314d..0000000
--- a/docs/source/2.x/digging-deeper.blade.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: Digging Deeper
-description: Digging Deeper | stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
-section: content
----
-
-# Digging Deeper {#digging-deeper}
-
diff --git a/docs/source/2.x/usage.blade.md b/docs/source/2.x/usage.blade.md
deleted file mode 100644
index de1d84f..0000000
--- a/docs/source/2.x/usage.blade.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-title: Usage
-description: Usage | stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
-section: content
----
-
-# Usage {#usage}
-
-This chapter describes usage of the package. That includes creating tenants, deleting tenants, storing data in the tenant storage.
-
-Most pages will use the `tenancy()` helper function. This package comes with two helpers - `tenancy()` and `tenant()`. They do the same thing, so you can use the one that reads better given its context.
-
-`tenant()->create()` reads better than `tenancy()->create()`, but `tenancy()->init()` reads better than `tenant()->init()`.
-
-You can pass an argument to the helper function to get a value out of the tenant storage. `tenant('plan')` is identical to [`tenant()->get('plan')`]({{ $page->link('tenant-storage') }}).
-
-The package also comes with two facades. `Tenancy` and `Tenant`. Use what feels the best.
-
-Both the helpers and the facades resolve the `TenantManager` from the service container.
\ No newline at end of file
diff --git a/docs/source/2.x/writing-storage-drivers.blade.md b/docs/source/2.x/writing-storage-drivers.blade.md
deleted file mode 100644
index 340abc7..0000000
--- a/docs/source/2.x/writing-storage-drivers.blade.md
+++ /dev/null
@@ -1,80 +0,0 @@
----
-title: Writing Storage Drivers
-description: Writing Storage Drivers with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
-section: content
----
-
-# Writing Storage Drivers
-
-If you don't want to use the provided DB/Redis storage drivers, you can write your own driver.
-
-To create a driver, create a class that implements the `Stancl\Tenancy\Interfaces\StorageDriver` interface.
-
-For historical reasons, the `TenantManager` will try to json encode/decode data coming from the storage driver. If you want to avoid this, set `public $useJson = false;`. That will make `TenantManager` encode/decode only `put()` and `get()` data, so that data types can be stored correctly.
-
-The DB storage driver has `public $useJson = false;`, while the Redis storage driver doesn't use this property, so it's false by default.
-
-Here's an example:
-
-```php
-
-namespace App\StorageDrivers\MongoDBStorageDriver;
-
-use Stancl\Tenancy\Interfaces\StorageDriver;
-
-class MongoDBStorageDriver implements StorageDriver
-{
- public $useJson = false;
-
- public function identifyTenant(string $domain): array
- {
- //
- }
-
- public function getAllTenants(array $uuids = []): array
- {
- //
- }
-
- public function getTenantById(string $uuid, array $fields = []): array
- {
- //
- }
-
- public function getTenantIdByDomain(string $domain): ?string
- {
- //
- }
-
- public function createTenant(string $domain, string $uuid): array
- {
- //
- }
-
- public function deleteTenant(string $uuid): bool
- {
- //
- }
-
- public function get(string $uuid, string $key)
- {
- //
- }
-
- public function getMany(string $uuid, array $keys): array
- {
- //
- }
-
- public function put(string $uuid, string $key, $value)
- {
- //
- }
-
- public function putMany(string $uuid, array $values): array
- {
- //
- }
-}
-```
\ No newline at end of file
diff --git a/docs/source/_layouts/documentation_v2.blade.php b/docs/source/_layouts/documentation_v2.blade.php
new file mode 100644
index 0000000..933d48e
--- /dev/null
+++ b/docs/source/_layouts/documentation_v2.blade.php
@@ -0,0 +1,19 @@
+@extends('_layouts.master_v2')
+
+@section('nav-toggle')
+ @include('_nav.menu-toggle')
+@endsection
+
+@section('body')
+
+
+
+
+
+ @yield('content')
+
+
+
+@endsection
diff --git a/docs/source/_layouts/master.blade.php b/docs/source/_layouts/master.blade.php
index 745b979..d09b1c5 100644
--- a/docs/source/_layouts/master.blade.php
+++ b/docs/source/_layouts/master.blade.php
@@ -32,7 +32,7 @@
@endif
-
+
@if ($page->docsearchApiKey && $page->docsearchIndexName)
@@ -59,10 +59,10 @@
-
+
@foreach($page->versions as $version => $name)
version() === $version)
selected
@endif
diff --git a/docs/source/_layouts/master_v2.blade.php b/docs/source/_layouts/master_v2.blade.php
new file mode 100644
index 0000000..eeab3b6
--- /dev/null
+++ b/docs/source/_layouts/master_v2.blade.php
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @if ($page->docsearchApiKey && $page->docsearchIndexName)
+
+ @endif
+
+ {{ $page->title ? $page->title . ' | ' : '' }}{{ $page->siteName }}
+
+
+
+
+ @stack('meta')
+
+ @if ($page->production)
+
+ @endif
+
+
+
+
+ @if ($page->docsearchApiKey && $page->docsearchIndexName)
+
+ @endif
+
+
+
+
+
+
+ @yield('body')
+
+
+
+
+ @stack('scripts')
+
+
+
+
+
diff --git a/docs/source/index.blade.php b/docs/source/index.blade.php
index f837574..6503e05 100644
--- a/docs/source/index.blade.php
+++ b/docs/source/index.blade.php
@@ -2,7 +2,7 @@
-
+
stancl/tenancy
\ No newline at end of file
diff --git a/docs/source/1.x/application-testing.blade.md b/docs/source/v1/application-testing.blade.md
similarity index 100%
rename from docs/source/1.x/application-testing.blade.md
rename to docs/source/v1/application-testing.blade.md
diff --git a/docs/source/1.x/configuration.blade.md b/docs/source/v1/configuration.blade.md
similarity index 100%
rename from docs/source/1.x/configuration.blade.md
rename to docs/source/v1/configuration.blade.md
diff --git a/docs/source/1.x/console-commands.blade.md b/docs/source/v1/console-commands.blade.md
similarity index 100%
rename from docs/source/1.x/console-commands.blade.md
rename to docs/source/v1/console-commands.blade.md
diff --git a/docs/source/1.x/creating-tenants.blade.md b/docs/source/v1/creating-tenants.blade.md
similarity index 100%
rename from docs/source/1.x/creating-tenants.blade.md
rename to docs/source/v1/creating-tenants.blade.md
diff --git a/docs/source/1.x/custom-database-names.blade.md b/docs/source/v1/custom-database-names.blade.md
similarity index 100%
rename from docs/source/1.x/custom-database-names.blade.md
rename to docs/source/v1/custom-database-names.blade.md
diff --git a/docs/source/1.x/development.blade.md b/docs/source/v1/development.blade.md
similarity index 100%
rename from docs/source/1.x/development.blade.md
rename to docs/source/v1/development.blade.md
diff --git a/docs/source/1.x/difference-between-this-package-and-others.blade.md b/docs/source/v1/difference-between-this-package-and-others.blade.md
similarity index 100%
rename from docs/source/1.x/difference-between-this-package-and-others.blade.md
rename to docs/source/v1/difference-between-this-package-and-others.blade.md
diff --git a/docs/source/1.x/digging-deeper.blade.md b/docs/source/v1/digging-deeper.blade.md
similarity index 100%
rename from docs/source/1.x/digging-deeper.blade.md
rename to docs/source/v1/digging-deeper.blade.md
diff --git a/docs/source/1.x/event-system.blade.md b/docs/source/v1/event-system.blade.md
similarity index 100%
rename from docs/source/1.x/event-system.blade.md
rename to docs/source/v1/event-system.blade.md
diff --git a/docs/source/1.x/filesystem-tenancy.blade.md b/docs/source/v1/filesystem-tenancy.blade.md
similarity index 100%
rename from docs/source/1.x/filesystem-tenancy.blade.md
rename to docs/source/v1/filesystem-tenancy.blade.md
diff --git a/docs/source/1.x/getting-started.blade.md b/docs/source/v1/getting-started.blade.md
similarity index 100%
rename from docs/source/1.x/getting-started.blade.md
rename to docs/source/v1/getting-started.blade.md
diff --git a/docs/source/1.x/horizon.blade.md b/docs/source/v1/horizon.blade.md
similarity index 100%
rename from docs/source/1.x/horizon.blade.md
rename to docs/source/v1/horizon.blade.md
diff --git a/docs/source/1.x/https-certificates.blade.md b/docs/source/v1/https-certificates.blade.md
similarity index 100%
rename from docs/source/1.x/https-certificates.blade.md
rename to docs/source/v1/https-certificates.blade.md
diff --git a/docs/source/1.x/index.html b/docs/source/v1/index.html
similarity index 100%
rename from docs/source/1.x/index.html
rename to docs/source/v1/index.html
diff --git a/docs/source/1.x/installation.blade.md b/docs/source/v1/installation.blade.md
similarity index 100%
rename from docs/source/1.x/installation.blade.md
rename to docs/source/v1/installation.blade.md
diff --git a/docs/source/1.x/integrations.blade.md b/docs/source/v1/integrations.blade.md
similarity index 100%
rename from docs/source/1.x/integrations.blade.md
rename to docs/source/v1/integrations.blade.md
diff --git a/docs/source/1.x/jobs-queues.blade.md b/docs/source/v1/jobs-queues.blade.md
similarity index 100%
rename from docs/source/1.x/jobs-queues.blade.md
rename to docs/source/v1/jobs-queues.blade.md
diff --git a/docs/source/1.x/middleware-configuration.blade.md b/docs/source/v1/middleware-configuration.blade.md
similarity index 100%
rename from docs/source/1.x/middleware-configuration.blade.md
rename to docs/source/v1/middleware-configuration.blade.md
diff --git a/docs/source/1.x/misc-tips.blade.md b/docs/source/v1/misc-tips.blade.md
similarity index 100%
rename from docs/source/1.x/misc-tips.blade.md
rename to docs/source/v1/misc-tips.blade.md
diff --git a/docs/source/1.x/stay-updated.blade.md b/docs/source/v1/stay-updated.blade.md
similarity index 100%
rename from docs/source/1.x/stay-updated.blade.md
rename to docs/source/v1/stay-updated.blade.md
diff --git a/docs/source/1.x/storage-drivers.blade.md b/docs/source/v1/storage-drivers.blade.md
similarity index 100%
rename from docs/source/1.x/storage-drivers.blade.md
rename to docs/source/v1/storage-drivers.blade.md
diff --git a/docs/source/1.x/telescope.blade.md b/docs/source/v1/telescope.blade.md
similarity index 100%
rename from docs/source/1.x/telescope.blade.md
rename to docs/source/v1/telescope.blade.md
diff --git a/docs/source/1.x/tenancy-initialization.blade.md b/docs/source/v1/tenancy-initialization.blade.md
similarity index 100%
rename from docs/source/1.x/tenancy-initialization.blade.md
rename to docs/source/v1/tenancy-initialization.blade.md
diff --git a/docs/source/1.x/tenant-manager.blade.md b/docs/source/v1/tenant-manager.blade.md
similarity index 100%
rename from docs/source/1.x/tenant-manager.blade.md
rename to docs/source/v1/tenant-manager.blade.md
diff --git a/docs/source/1.x/tenant-routes.blade.md b/docs/source/v1/tenant-routes.blade.md
similarity index 100%
rename from docs/source/1.x/tenant-routes.blade.md
rename to docs/source/v1/tenant-routes.blade.md
diff --git a/docs/source/1.x/tenant-storage.blade.md b/docs/source/v1/tenant-storage.blade.md
similarity index 100%
rename from docs/source/1.x/tenant-storage.blade.md
rename to docs/source/v1/tenant-storage.blade.md
diff --git a/docs/source/1.x/usage.blade.md b/docs/source/v1/usage.blade.md
similarity index 100%
rename from docs/source/1.x/usage.blade.md
rename to docs/source/v1/usage.blade.md
diff --git a/docs/source/1.x/writing-storage-drivers.blade.md b/docs/source/v1/writing-storage-drivers.blade.md
similarity index 100%
rename from docs/source/1.x/writing-storage-drivers.blade.md
rename to docs/source/v1/writing-storage-drivers.blade.md
diff --git a/docs/source/2.x/application-testing.blade.md b/docs/source/v2/application-testing.blade.md
similarity index 77%
rename from docs/source/2.x/application-testing.blade.md
rename to docs/source/v2/application-testing.blade.md
index 4914a64..e70df0d 100644
--- a/docs/source/2.x/application-testing.blade.md
+++ b/docs/source/v2/application-testing.blade.md
@@ -1,7 +1,7 @@
---
title: Application Testing
-description: Application Testing with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: Application Testing..
+extends: _layouts.documentation_v2
section: content
---
@@ -14,12 +14,12 @@ protected function setUp(): void
{
parent::setUp();
- tenant()->create('test.localhost');
+ tenancy()->create('test.localhost');
tenancy()->init('test.localhost');
}
```
-If you're using the database storage driver, you will also need to run the `create_tenants_table` migration:
+If you're using the database storage driver, you will also need to run the migrations:
```php
protected function setUp(): void
{
@@ -30,7 +30,7 @@ protected function setUp(): void
'--database' => 'sqlite',
]);
- tenant()->create('test.localhost');
+ tenancy()->create('test.localhost');
tenancy()->init('test.localhost');
}
```
diff --git a/docs/source/2.x/configuration.blade.md b/docs/source/v2/configuration.blade.md
similarity index 82%
rename from docs/source/2.x/configuration.blade.md
rename to docs/source/v2/configuration.blade.md
index d3d7513..249263c 100644
--- a/docs/source/2.x/configuration.blade.md
+++ b/docs/source/v2/configuration.blade.md
@@ -1,7 +1,7 @@
---
title: Configuration
-description: Configuring stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: Configuring stancl/tenancy
+extends: _layouts.documentation_v2
section: content
---
@@ -29,28 +29,28 @@ If a hostname from this array is visited, the `tenant.php` routes won't be regis
### `database` {#database}
-The application's default connection will be switched to a new one — `tenant`. This connection will be based on the connection specified in `tenancy.database.based_on`. The database name will be `tenancy.database.prefix + tenant UUID + tenancy.database.suffix`.
+The application's default connection will be switched to a new one — `tenant`. This connection will be based on the connection specified in `tenancy.database.based_on`. The database name will be `tenancy.database.prefix + tenant id + tenancy.database.suffix`.
You can set the suffix to `.sqlite` if you're using sqlite and want the files to be with the `.sqlite` extension. Conversely, you can leave the suffix empty if you're using MySQL, for example.
### `redis` {#redis}
-If `tenancy.redis.tenancy` is set to true, connections listed in `tenancy.redis.prefixed_connections` will be prefixed with `config('tenancy.redis.prefix_base') . $uuid`.
+If `tenancy.redis.tenancy` is set to true, connections listed in `tenancy.redis.prefixed_connections` will be prefixed with `config('tenancy.redis.prefix_base') . $id`.
-> Note: You need phpredis for multi-tenant Redis.
+> Note: You need phpredis. Predis support will dropped by Laravel on version 7.
### `cache` {#cache}
-The `CacheManager` instance that's resolved when you use the `Cache` or the `cache()` helper will be replaced by `Stancl\Tenancy\CacheManager`. This class automatically uses [tags](https://laravel.com/docs/master/cache#cache-tags). The tag will look like `config('tenancy.cache.tag_base') . $uuid`.
+The `CacheManager` instance that's resolved when you use the `Cache` or the `cache()` helper will be replaced by `Stancl\Tenancy\CacheManager`. This class automatically uses [tags](https://laravel.com/docs/master/cache#cache-tags). The tag will look like `config('tenancy.cache.tag_base') . $id`.
If you need to store something in global, non-tenant cache,
### `filesystem` {#filesystem}
-The `storage_path()` will be suffixed with a directory named `config('tenancy.filesystem.suffix_base') . $uuid`.
+The `storage_path()` will be suffixed with a directory named `config('tenancy.filesystem.suffix_base') . $id`.
-The root of each disk listed in `tenancy.filesystem.disks` will be suffixed with `config('tenancy.filesystem.suffix_base') . $uuid`.
+The root of each disk listed in `tenancy.filesystem.disks` will be suffixed with `config('tenancy.filesystem.suffix_base') . $id`.
-For disks listed in `root_override`, the root will be that string with `%storage_path%` replaced by `storage_path()` *after* tenancy has been initialized. All other disks will be simply suffixed with `tenancy.filesystem.suffix_base` + the tenant UUID.
+For disks listed in `root_override`, the root will be that string with `%storage_path%` replaced by `storage_path()` *after* tenancy has been initialized. All other disks will be simply suffixed with `tenancy.filesystem.suffix_base` + the tenant id.
Read more about this on the [Filesystem Tenancy]({{ $page->link('filesystem-tenancy') }}) page.
\ No newline at end of file
diff --git a/docs/source/2.x/console-commands.blade.md b/docs/source/v2/console-commands.blade.md
similarity index 80%
rename from docs/source/2.x/console-commands.blade.md
rename to docs/source/v2/console-commands.blade.md
index 401a0e4..b8ce69a 100644
--- a/docs/source/2.x/console-commands.blade.md
+++ b/docs/source/v2/console-commands.blade.md
@@ -1,7 +1,7 @@
---
title: Console Commands
-description: Console commands with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: Console commands..
+extends: _layouts.documentation_v2
section: content
---
@@ -22,10 +22,10 @@ php artisan tenants:migrate --tenants=8075a580-1cb8-11e9-8822-49c5d8f8ff23
You can use these commands outside the command line as well. If you want to migrate a tenant's database in a controller, you can use the `Artisan` facade.
```php
-$tenant = tenant()->create('tenant1.localhost');
+$tenant = tenancy()->create('tenant1.localhost');
\Artisan::call('tenants:migrate', [
- '--tenants' => [$tenant['uuid']]
+ '--tenants' => [$tenant['id']]
]);
```
@@ -50,8 +50,8 @@ php artisan tenants:run email:send --tenants=8075a580-1cb8-11e9-8822-49c5d8f8ff2
```none
php artisan tenants:list
Listing all tenants.
-[Tenant] uuid: dbe0b330-1a6e-11e9-b4c3-354da4b4f339 @ localhost
-[Tenant] uuid: 49670df0-1a87-11e9-b7ba-cf5353777957 @ dev.localhost
+[Tenant] id: dbe0b330-1a6e-11e9-b4c3-354da4b4f339 @ localhost
+[Tenant] id: 49670df0-1a87-11e9-b7ba-cf5353777957 @ dev.localhost
```
## Selectively clearing tenant cache {#selectively-clearing-tenant-cache}
@@ -61,4 +61,4 @@ You can delete specific tenants' cache by using the `--tags` option on `cache:cl
php artisan cache:clear --tags=tenantdbe0b330-1a6e-11e9-b4c3-354da4b4f339
```
-The tag is `config('tenancy.cache.tag_base') . $uuid`.
\ No newline at end of file
+The tag is `config('tenancy.cache.tag_base') . $id`.
\ No newline at end of file
diff --git a/docs/source/2.x/creating-tenants.blade.md b/docs/source/v2/creating-tenants.blade.md
similarity index 85%
rename from docs/source/2.x/creating-tenants.blade.md
rename to docs/source/v2/creating-tenants.blade.md
index d17d487..2a3c83c 100644
--- a/docs/source/2.x/creating-tenants.blade.md
+++ b/docs/source/v2/creating-tenants.blade.md
@@ -1,7 +1,7 @@
---
title: Creating Tenants
-description: Creating tenants with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: Creating tenants..
+extends: _layouts.documentation_v2
section: content
---
diff --git a/docs/source/2.x/custom-database-names.blade.md b/docs/source/v2/custom-database-names.blade.md
similarity index 73%
rename from docs/source/2.x/custom-database-names.blade.md
rename to docs/source/v2/custom-database-names.blade.md
index 8aa3c1a..5b2fa4c 100644
--- a/docs/source/2.x/custom-database-names.blade.md
+++ b/docs/source/v2/custom-database-names.blade.md
@@ -1,7 +1,7 @@
---
title: Custom Database Names
-description: Custom Database Names with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: Custom Database Names..
+extends: _layouts.documentation_v2
section: content
---
@@ -10,11 +10,11 @@ section: content
If you want to specify the tenant's database name, set the `tenancy.database_name_key` configuration key to the name of the key that is used to specify the database name in the tenant storage. You must use a name that you won't use for storing other data, so it's recommended to avoid names like `database` and use names like `_stancl_tenancy_database_name` instead. Then just give the key a value during the tenant creation process:
```php
->>> tenant()->create('example.com', [
+>>> tenancy()->create('example.com', [
'_stancl_tenancy_database_name' => 'example_com'
])
=> [
- "uuid" => "49670df0-1a87-11e9-b7ba-cf5353777957",
+ "id" => "49670df0-1a87-11e9-b7ba-cf5353777957",
"domain" => "example.com",
"_stancl_tenancy_database_name" => "example_com",
]
diff --git a/docs/source/2.x/development.blade.md b/docs/source/v2/development.blade.md
similarity index 82%
rename from docs/source/2.x/development.blade.md
rename to docs/source/v2/development.blade.md
index d6b4f51..faedc05 100644
--- a/docs/source/2.x/development.blade.md
+++ b/docs/source/v2/development.blade.md
@@ -1,7 +1,7 @@
---
title: Development
-description: Development | stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: Development..
+extends: _layouts.documentation_v2
section: content
---
diff --git a/docs/source/2.x/difference-between-this-package-and-others.blade.md b/docs/source/v2/difference-between-this-package-and-others.blade.md
similarity index 83%
rename from docs/source/2.x/difference-between-this-package-and-others.blade.md
rename to docs/source/v2/difference-between-this-package-and-others.blade.md
index 29843e3..03f2bb8 100644
--- a/docs/source/2.x/difference-between-this-package-and-others.blade.md
+++ b/docs/source/v2/difference-between-this-package-and-others.blade.md
@@ -1,7 +1,7 @@
---
title: Difference Between This Package And Others
-description: Difference Between This Package And Others | with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.
-extends: _layouts.documentation
+description: Difference Between This Package And Others
+extends: _layouts.documentation_v2
section: content
---
diff --git a/docs/source/v2/digging-deeper.blade.md b/docs/source/v2/digging-deeper.blade.md
new file mode 100644
index 0000000..d6ac7da
--- /dev/null
+++ b/docs/source/v2/digging-deeper.blade.md
@@ -0,0 +1,9 @@
+---
+title: Digging Deeper
+description: Digging Deeper..
+extends: _layouts.documentation_v2
+section: content
+---
+
+# Digging Deeper {#digging-deeper}
+
diff --git a/docs/source/2.x/event-system.blade.md b/docs/source/v2/event-system.blade.md
similarity index 70%
rename from docs/source/2.x/event-system.blade.md
rename to docs/source/v2/event-system.blade.md
index f352462..a1fc735 100644
--- a/docs/source/2.x/event-system.blade.md
+++ b/docs/source/v2/event-system.blade.md
@@ -1,7 +1,7 @@
---
title: The Event System
-description: The Event System | stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: The Event System..
+extends: _layouts.documentation_v2
section: content
---
@@ -20,7 +20,7 @@ The following events are available:
You can hook into these events using `Tenancy::`:
```php
\Tenancy::boostrapping(function ($tenantManager) {
- if ($tenantManager->tenant['uuid'] === 'someUUID') {
+ if ($tenantManager->tenant['id'] === 'someID') {
config(['database.connections.someDatabaseConnection' => $tenantManager->tenant['databaseConnection']]);
$tenantManager->database->useConnection('someDatabaseConnection');
@@ -29,7 +29,7 @@ You can hook into these events using `Tenancy::`:
});
```
-The example above checks whether the current tenant has an uuid of `someUUID`. If yes, it creates a new database connection based on data stored in the tenant's storage. Then it changes the default database connection. Finally, it returns an array of the events that this callback prevents.
+The example above checks whether the current tenant has an id of `someID`. If yes, it creates a new database connection based on data stored in the tenant's storage. Then it changes the default database connection. Finally, it returns an array of the events that this callback prevents.
The following actions can be prevented:
- database connection switch: `database`
diff --git a/docs/source/2.x/filesystem-tenancy.blade.md b/docs/source/v2/filesystem-tenancy.blade.md
similarity index 89%
rename from docs/source/2.x/filesystem-tenancy.blade.md
rename to docs/source/v2/filesystem-tenancy.blade.md
index 499c8dc..5de9f95 100644
--- a/docs/source/2.x/filesystem-tenancy.blade.md
+++ b/docs/source/v2/filesystem-tenancy.blade.md
@@ -1,7 +1,7 @@
---
title: Filesystem Tenancy
-description: Filesystem Tenancy with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: Filesystem Tenancy..
+extends: _layouts.documentation_v2
section: content
---
@@ -9,13 +9,13 @@ section: content
> Note: It's important to differentiate between storage_path() and the Storage facade. The Storage facade is what you use to put files into storage, i.e. `Storage::disk('local')->put()`. `storage_path()` is used to get the path to the storage directory.
-The `storage_path()` will be suffixed with a directory named `config('tenancy.filesystem.suffix_base') . $uuid`.
+The `storage_path()` will be suffixed with a directory named `config('tenancy.filesystem.suffix_base') . $id`.
-The root of each disk listed in `tenancy.filesystem.disks` will be suffixed with `config('tenancy.filesystem.suffix_base') . $uuid`.
+The root of each disk listed in `tenancy.filesystem.disks` will be suffixed with `config('tenancy.filesystem.suffix_base') . $id`.
**However, this alone would cause unwanted behavior.** It would work for S3 and similar disks, but for local disks, this would result in `/path_to_your_application/storage/app/tenant1e22e620-1cb8-11e9-93b6-8d1b78ac0bcd/`. That's not what we want. We want `/path_to_your_application/storage/tenant1e22e620-1cb8-11e9-93b6-8d1b78ac0bcd/app/`.
-That's what the `root_override` section is for. `%storage_path%` gets replaced by `storage_path()` *after* tenancy has been initialized. The roots of disks listed in the `root_override` section of the config will be replaced accordingly. All other disks will be simply suffixed with `tenancy.filesystem.suffix_base` + the tenant UUID.
+That's what the `root_override` section is for. `%storage_path%` gets replaced by `storage_path()` *after* tenancy has been initialized. The roots of disks listed in the `root_override` section of the config will be replaced accordingly. All other disks will be simply suffixed with `tenancy.filesystem.suffix_base` + the tenant id.
Since `storage_path()` will be suffixed, your folder structure will look like this:
diff --git a/docs/source/2.x/getting-started.blade.md b/docs/source/v2/getting-started.blade.md
similarity index 81%
rename from docs/source/2.x/getting-started.blade.md
rename to docs/source/v2/getting-started.blade.md
index 18cc47c..958db29 100644
--- a/docs/source/2.x/getting-started.blade.md
+++ b/docs/source/v2/getting-started.blade.md
@@ -1,13 +1,13 @@
---
title: Getting Started
-description: Getting started with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.
-extends: _layouts.documentation
+description: Getting started.
+extends: _layouts.documentation_v2
section: content
---
# Getting Started {#getting-started}
-[**stancl/tenancy**](https://github.com/stancl/tenancy) is a Laravel multi-database tenancy package. It is designed in a way that requires you to make no changes to your codebase. Instead of applying traits on models and replacing every single reference to cache by a reference to a tenant-aware cache, the package lets you write your app without thinking about tenancy. It handles tenancy automatically.
+[**stancl/tenancy**](https://github.com/stancl/tenancy) is a Laravel multi-database tenancy package. It makes your app multi-tenant in a way that requires no changes to the codebase. Instead of applying traits on models and replacing every single reference to cache by a reference to a tenant-aware cache, the package lets you write your app without thinking about tenancy. It handles tenancy automatically in the background.
> Note: Filesystem is the only thing that can be a little problematic. Be sure to read [that page]({{ $page->link('filesystem-tenancy') }}).
diff --git a/docs/source/2.x/horizon.blade.md b/docs/source/v2/horizon.blade.md
similarity index 51%
rename from docs/source/2.x/horizon.blade.md
rename to docs/source/v2/horizon.blade.md
index 141f463..0de4d49 100644
--- a/docs/source/2.x/horizon.blade.md
+++ b/docs/source/v2/horizon.blade.md
@@ -1,7 +1,7 @@
---
title: Horizon Integration
-description: Horizon Integration with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: Horizon Integration..
+extends: _layouts.documentation_v2
section: content
---
@@ -9,9 +9,9 @@ section: content
> Make sure your queue is [correctly configured]({{ $page->link('jobs-queues') }}) before using Horizon.
-Jobs are automatically tagged with the tenant's uuid and domain:
+Jobs are automatically tagged with the tenant's id and domain:
-
+
You can use these tags to monitor specific tenants' jobs:
diff --git a/docs/source/2.x/https-certificates.blade.md b/docs/source/v2/https-certificates.blade.md
similarity index 92%
rename from docs/source/2.x/https-certificates.blade.md
rename to docs/source/v2/https-certificates.blade.md
index d693e32..402b067 100644
--- a/docs/source/2.x/https-certificates.blade.md
+++ b/docs/source/v2/https-certificates.blade.md
@@ -1,7 +1,7 @@
---
title: HTTPS Certificates
-description: HTTPS Certificates with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: HTTPS Certificates..
+extends: _layouts.documentation_v2
section: content
---
diff --git a/docs/source/2.x/index.html b/docs/source/v2/index.html
similarity index 100%
rename from docs/source/2.x/index.html
rename to docs/source/v2/index.html
diff --git a/docs/source/2.x/installation.blade.md b/docs/source/v2/installation.blade.md
similarity index 93%
rename from docs/source/2.x/installation.blade.md
rename to docs/source/v2/installation.blade.md
index 9607d0a..e8e63a5 100644
--- a/docs/source/2.x/installation.blade.md
+++ b/docs/source/v2/installation.blade.md
@@ -1,7 +1,7 @@
---
title: Installation
-description: Installing stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: Installing stancl/tenancy
+extends: _layouts.documentation_v2
section: content
---
diff --git a/docs/source/2.x/integrations.blade.md b/docs/source/v2/integrations.blade.md
similarity index 79%
rename from docs/source/2.x/integrations.blade.md
rename to docs/source/v2/integrations.blade.md
index 15ae4e9..bec30a7 100644
--- a/docs/source/2.x/integrations.blade.md
+++ b/docs/source/v2/integrations.blade.md
@@ -1,7 +1,7 @@
---
title: Integrations
-description: Integrating stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: Integrating stancl/tenancy
+extends: _layouts.documentation_v2
section: content
---
diff --git a/docs/source/2.x/jobs-queues.blade.md b/docs/source/v2/jobs-queues.blade.md
similarity index 86%
rename from docs/source/2.x/jobs-queues.blade.md
rename to docs/source/v2/jobs-queues.blade.md
index 8053da9..597cfcb 100644
--- a/docs/source/2.x/jobs-queues.blade.md
+++ b/docs/source/v2/jobs-queues.blade.md
@@ -1,7 +1,7 @@
---
title: Jobs & Queues
-description: Jobs & Queues with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: Jobs & Queues..
+extends: _layouts.documentation_v2
section: content
---
diff --git a/docs/source/2.x/middleware-configuration.blade.md b/docs/source/v2/middleware-configuration.blade.md
similarity index 78%
rename from docs/source/2.x/middleware-configuration.blade.md
rename to docs/source/v2/middleware-configuration.blade.md
index eb69837..ca49e41 100644
--- a/docs/source/2.x/middleware-configuration.blade.md
+++ b/docs/source/v2/middleware-configuration.blade.md
@@ -1,7 +1,7 @@
---
title: Middleware Configuration
-description: Middleware Configuration with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: Middleware Configuration..
+extends: _layouts.documentation_v2
section: content
---
diff --git a/docs/source/2.x/misc-tips.blade.md b/docs/source/v2/misc-tips.blade.md
similarity index 83%
rename from docs/source/2.x/misc-tips.blade.md
rename to docs/source/v2/misc-tips.blade.md
index 82b11a6..064c038 100644
--- a/docs/source/2.x/misc-tips.blade.md
+++ b/docs/source/v2/misc-tips.blade.md
@@ -1,7 +1,7 @@
---
title: Miscellaneous Tips
-description: Miscellaneous Tips | stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: Miscellaneous Tips..
+extends: _layouts.documentation_v2
section: content
---
@@ -34,3 +34,4 @@ class MyUniqueIDGenerator implements UniqueIdentifierGenerator
and then set the `tenancy.unique_id_generator` config to the full path to your class.
+Note that you may have to make the `id` column on the `tenants` table larger, as it's set to the exact length of uuids by default.
diff --git a/docs/source/2.x/stay-updated.blade.md b/docs/source/v2/stay-updated.blade.md
similarity index 81%
rename from docs/source/2.x/stay-updated.blade.md
rename to docs/source/v2/stay-updated.blade.md
index 018de1b..623c23b 100644
--- a/docs/source/2.x/stay-updated.blade.md
+++ b/docs/source/v2/stay-updated.blade.md
@@ -1,7 +1,7 @@
---
title: Stay Updated
-description: Stay Updated | stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: Stay Updated..
+extends: _layouts.documentation_v2
section: content
---
diff --git a/docs/source/2.x/storage-drivers.blade.md b/docs/source/v2/storage-drivers.blade.md
similarity index 95%
rename from docs/source/2.x/storage-drivers.blade.md
rename to docs/source/v2/storage-drivers.blade.md
index ede9851..00f3a0d 100644
--- a/docs/source/2.x/storage-drivers.blade.md
+++ b/docs/source/v2/storage-drivers.blade.md
@@ -1,7 +1,7 @@
---
title: Storage Drivers
-description: Storage Drivers of stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: Storage Drivers
+extends: _layouts.documentation_v2
section: content
---
diff --git a/docs/source/2.x/telescope.blade.md b/docs/source/v2/telescope.blade.md
similarity index 69%
rename from docs/source/2.x/telescope.blade.md
rename to docs/source/v2/telescope.blade.md
index ee9cb5e..764b5c4 100644
--- a/docs/source/2.x/telescope.blade.md
+++ b/docs/source/v2/telescope.blade.md
@@ -1,19 +1,19 @@
---
title: Telescope Integration
-description: Telescope Integration with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: Telescope Integration..
+extends: _layouts.documentation_v2
section: content
---
# Telescope Integration
-Requests in Telescope are automatically tagged with the tenant uuid and domain:
+Requests in Telescope are automatically tagged with the tenant id and domain:

-This lets you filter requests by uuid and domain:
+This lets you filter requests by id and domain:
-
+

If you'd like to set Telescope tags in your own code, e.g. in your `AppServiceProvider`, replace your `Telescope::tag()` call like this:
diff --git a/docs/source/2.x/tenancy-initialization.blade.md b/docs/source/v2/tenancy-initialization.blade.md
similarity index 91%
rename from docs/source/2.x/tenancy-initialization.blade.md
rename to docs/source/v2/tenancy-initialization.blade.md
index 7f8c218..1f247a5 100644
--- a/docs/source/2.x/tenancy-initialization.blade.md
+++ b/docs/source/v2/tenancy-initialization.blade.md
@@ -1,7 +1,7 @@
---
title: Tenancy Initialization
-description: Tenancy Initialization with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: Tenancy Initialization..
+extends: _layouts.documentation_v2
section: content
---
@@ -28,7 +28,7 @@ public function switchDatabaseConnection()
}
```
-If `tenancy.database_name_key` is set and present in the current tenant's data, the `getDatabaseName()` returns the stored database_name. Otherwise it returns the prefix + uuid + suffix.
+If `tenancy.database_name_key` is set and present in the current tenant's data, the `getDatabaseName()` returns the stored database_name. Otherwise it returns the prefix + id + suffix.
```php
public function getDatabaseName($tenant = []): string
@@ -39,7 +39,7 @@ public function getDatabaseName($tenant = []): string
return $tenant[$key];
}
}
- return $this->app['config']['tenancy.database.prefix'] . $tenant['uuid'] . $this->app['config']['tenancy.database.suffix'];
+ return $this->app['config']['tenancy.database.prefix'] . $tenant['id'] . $this->app['config']['tenancy.database.suffix'];
}
```
@@ -75,13 +75,13 @@ public function useConnection(string $connection)
The `bootstrap()` method calls `setPhpRedisPrefix()` if `tenancy.redis.tenancy` is `true`.
-This method cycles through the `tenancy.redis.prefixed_connections` and sets their prefix to `tenancy.redis.prefix_base` + uuid.
+This method cycles through the `tenancy.redis.prefixed_connections` and sets their prefix to `tenancy.redis.prefix_base` + id.
```php
public function setPhpRedisPrefix($connections = ['default'])
{
// [...]
foreach ($connections as $connection) {
- $prefix = $this->app['config']['tenancy.redis.prefix_base'] . $this->tenant['uuid'];
+ $prefix = $this->app['config']['tenancy.redis.prefix_base'] . $this->tenant['id'];
$client = Redis::connection($connection)->client();
try {
// [...]
@@ -112,7 +112,7 @@ class CacheManager extends BaseCacheManager
{
public function __call($method, $parameters)
{
- $tags = [config('tenancy.cache.tag_base') . tenant('uuid')];
+ $tags = [config('tenancy.cache.tag_base') . tenant('id')];
if ($method === 'tags') {
if (\count($parameters) !== 1) {
throw new \Exception("Method tags() takes exactly 1 argument. {count($parameters)} passed.");
@@ -134,7 +134,7 @@ class CacheManager extends BaseCacheManager
public function suffixFilesystemRootPaths()
{
// [...]
- $suffix = $this->app['config']['tenancy.filesystem.suffix_base'] . tenant('uuid');
+ $suffix = $this->app['config']['tenancy.filesystem.suffix_base'] . tenant('id');
// storage_path()
$this->app->useStoragePath($old['path'] . "/{$suffix}");
// Storage facade
diff --git a/docs/source/2.x/tenant-manager.blade.md b/docs/source/v2/tenant-manager.blade.md
similarity index 83%
rename from docs/source/2.x/tenant-manager.blade.md
rename to docs/source/v2/tenant-manager.blade.md
index f9ed1e8..4b9f5db 100644
--- a/docs/source/2.x/tenant-manager.blade.md
+++ b/docs/source/v2/tenant-manager.blade.md
@@ -1,7 +1,7 @@
---
title: Tenant Manager
-description: Tenant Manager | stancl/tenancy — A Laravel multi-database tenancy package that respects your code.
-extends: _layouts.documentation
+description: Tenant Manager.
+extends: _layouts.documentation_v2
section: content
---
@@ -9,14 +9,14 @@ section: content
This page documents a couple of other `TenantManager` methods you may find useful.
-### Finding tenant using UUID
+### Finding tenant using id
`find()` is an alias for `getTenantById()`. You may use the second argument to specify the key(s) as a string/array.
```php
>>> tenant()->find('dbe0b330-1a6e-11e9-b4c3-354da4b4f339');
=> [
- "uuid" => "dbe0b330-1a6e-11e9-b4c3-354da4b4f339",
+ "id" => "dbe0b330-1a6e-11e9-b4c3-354da4b4f339",
"domain" => "localhost",
"foo" => "bar",
]
@@ -47,7 +47,7 @@ You may use the second argument to specify the key(s) as a string/array.
```php
>>> tenant()->findByDomain('localhost');
=> [
- "uuid" => "b3ce3f90-1a88-11e9-a6b0-038c6337ae50",
+ "id" => "b3ce3f90-1a88-11e9-a6b0-038c6337ae50",
"domain" => "localhost",
]
```
@@ -63,7 +63,7 @@ tenancy()->tenant
which is an array. If you want to get the value of a specific key from the array, you can use one of the helpers the key on the tenant array as an argument.
```php
-tenant('uuid'); // Does the same thing as tenant()->tenant['uuid']
+tenant('id'); // Does the same thing as tenancy()->getTenant('id')
```
### Getting all tenants
@@ -75,11 +75,11 @@ This method returns a collection of arrays.
=> Illuminate\Support\Collection {#2980
all: [
[
- "uuid" => "32e20780-1a88-11e9-a051-4b6489a7edac",
+ "id" => "32e20780-1a88-11e9-a051-4b6489a7edac",
"domain" => "localhost",
],
[
- "uuid" => "49670df0-1a87-11e9-b7ba-cf5353777957",
+ "id" => "49670df0-1a87-11e9-b7ba-cf5353777957",
"domain" => "dev.localhost",
],
],
diff --git a/docs/source/2.x/tenant-routes.blade.md b/docs/source/v2/tenant-routes.blade.md
similarity index 92%
rename from docs/source/2.x/tenant-routes.blade.md
rename to docs/source/v2/tenant-routes.blade.md
index 8b59fdc..73a586c 100644
--- a/docs/source/2.x/tenant-routes.blade.md
+++ b/docs/source/v2/tenant-routes.blade.md
@@ -1,7 +1,7 @@
---
title: Tenant Routes
-description: Tenant routes with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: Tenant routes..
+extends: _layouts.documentation_v2
section: content
---
diff --git a/docs/source/2.x/tenant-storage.blade.md b/docs/source/v2/tenant-storage.blade.md
similarity index 58%
rename from docs/source/2.x/tenant-storage.blade.md
rename to docs/source/v2/tenant-storage.blade.md
index c78609f..ebb9bb3 100644
--- a/docs/source/2.x/tenant-storage.blade.md
+++ b/docs/source/v2/tenant-storage.blade.md
@@ -1,32 +1,32 @@
---
title: Tenant Storage
-description: Tenant storage with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
-extends: _layouts.documentation
+description: Tenant storage..
+extends: _layouts.documentation_v2
section: content
---
# Tenant Storage {#tenant-storage}
-Tenant storage is where tenants' uuids and domains are stored. You can store things like the tenant's plan, subscription information, and tenant-specific application configuration in tenant storage. You can use these functions:
+Tenant storage is where tenants' ids and domains are stored. You can store things like the tenant's plan, subscription information, and tenant-specific application configuration in tenant storage. You can use these functions:
```php
-get (string|array $key, string $uuid = null) // $uuid defaults to the current tenant's UUID
-put (string|array $key, mixed $value = null, string $uuid = null) // if $key is array, make sure $value is null
+get (string|array $key, string $id = null) // $id defaults to the current tenant's id
+put (string|array $key, mixed $value = null, string $id = null) // if $key is array, make sure $value is null
```
To put something into the tenant storage, you can use `put()` or `set()`.
```php
tenancy()->put($key, $value);
tenancy()->set($key, $value); // alias for put()
-tenancy()->put($key, $value, $uuid);
+tenancy()->put($key, $value, $id);
tenancy()->put(['key1' => 'value1', 'key2' => 'value2']);
-tenancy()->put(['key1' => 'value1', 'key2' => 'value2'], null, $uuid);
+tenancy()->put(['key1' => 'value1', 'key2' => 'value2'], null, $id);
```
To get something from the storage, you can use `get()`:
```php
tenancy()->get($key);
-tenancy()->get($key, $uuid);
+tenancy()->get($key, $id);
tenancy()->get(['key1', 'key2']);
```
diff --git a/docs/source/v2/usage.blade.md b/docs/source/v2/usage.blade.md
new file mode 100644
index 0000000..c700e39
--- /dev/null
+++ b/docs/source/v2/usage.blade.md
@@ -0,0 +1,16 @@
+---
+title: Usage
+description: Usage..
+extends: _layouts.documentation_v2
+section: content
+---
+
+# Usage {#usage}
+
+This chapter describes usage of the package. That includes creating tenants, deleting tenants, storing data in the tenant storage.
+
+This package comes with two helpers - `tenancy()` and `tenant()`. `tenancy()` returns an instance of `TenantManager` and should be primarily used only for `tenancy()->all()`, but for legacy reasons it can be used to create tenants.
+
+You can pass an argument to the helper function to get a value out of the tenant storage. `tenant('plan')` is identical to [`tenant()->get('plan')`]({{ $page->link('tenant-storage') }}).
+
+The package also comes with two facades. `Tenancy` -- for `TenantManager` -- and `Tenant` -- for the current `Tenant`, or null if no tenant has been identified yet.
diff --git a/docs/source/v2/writing-storage-drivers.blade.md b/docs/source/v2/writing-storage-drivers.blade.md
new file mode 100644
index 0000000..eb37d2f
--- /dev/null
+++ b/docs/source/v2/writing-storage-drivers.blade.md
@@ -0,0 +1,85 @@
+---
+title: Writing Storage Drivers
+description: Writing Storage Drivers
+extends: _layouts.documentation_v2
+section: content
+---
+
+# Writing Storage Drivers
+
+If you don't want to use the provided DB/Redis storage drivers, you can write your own driver.
+
+To create a driver, create a class that implements the `Stancl\Tenancy\Interfaces\StorageDriver` interface.
+
+Here's an example:
+
+```php
+
+namespace App\StorageDrivers\MongoDBStorageDriver;
+
+use Stancl\Tenancy\Tenant;
+use Stancl\Tenancy\Interfaces\StorageDriver;
+
+class MongoDBStorageDriver implements StorageDriver
+{
+ public function createTenant(Tenant $tenant): void
+ {
+ //
+ }
+
+ public function updateTenant(Tenant $tenant): void
+ {
+ //
+ }
+
+ public function deleteTenant(Tenant $tenant): void
+ {
+ //
+ }
+
+ public function findById(string $id): Tenant
+ {
+ //
+ }
+
+ public function findByDomain(string $domain): Tenant
+ {
+ //
+ }
+
+ public function all(array $ids = []): array
+ {
+ //
+ }
+
+ public function ensureTenantCanBeCreated(Tenant $tenant): void
+ {
+ //
+ }
+
+ public function withDefaultTenant(Tenant $tenant)
+ {
+ //
+ }
+
+ public function get(string $key, Tenant $tenant = null)
+ {
+ //
+ }
+
+ public function getMany(array $keys, Tenant $tenant = null)
+ {
+ //
+ }
+
+ public function put(string $key, $value, Tenant $tenant = null): void
+ {
+ //
+ }
+
+ public function putMany(array $kvPairs, Tenant $tenant = null): void
+ {
+ //
+ }
+}
+```
\ No newline at end of file
diff --git a/netlify.toml b/netlify.toml
index 4cda698..cb6679e 100644
--- a/netlify.toml
+++ b/netlify.toml
@@ -5,5 +5,5 @@ command = "./build.sh"
[[redirects]]
from = "/docs/master/*"
-to = "/docs/2.x/:splat"
+to = "/docs/v2/:splat"
status = 302
\ No newline at end of file
diff --git a/preview.sh b/preview.sh
new file mode 100755
index 0000000..8f2bd39
--- /dev/null
+++ b/preview.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+cd docs
+vendor/bin/jigsaw build && vendor/bin/jigsaw serve -p 9999
\ No newline at end of file