mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 18:24:03 +00:00
Features
This commit is contained in:
parent
be8d1fa497
commit
c69505a09a
8 changed files with 51 additions and 14 deletions
|
|
@ -78,7 +78,6 @@ return [
|
|||
'children' => [
|
||||
'Tenants' => 'tenants',
|
||||
'Central App' => 'central-app',
|
||||
'Tenant Config' => 'tenant-config',
|
||||
'Middleware Configuration' => 'middleware-configuration',
|
||||
'Custom Database Names' => 'custom-database-names',
|
||||
'Custom DB Connections' => 'custom-db-connections',
|
||||
|
|
@ -91,6 +90,14 @@ return [
|
|||
'Writing Storage Drivers' => 'writing-storage-drivers',
|
||||
],
|
||||
],
|
||||
'Optional Features' => [
|
||||
'url' => 'features',
|
||||
'children' => [
|
||||
'Tenant Config' => 'features/tenant-config',
|
||||
'Timestamps' => 'features/timestamps',
|
||||
'Tenant Redirect' => 'features/tenant-redirect',
|
||||
],
|
||||
],
|
||||
'Integrations' => [
|
||||
'url' => 'integrations',
|
||||
'children' => [
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ The aliases are used by the [event system]({{ $page->link('hooks') }})
|
|||
|
||||
### `features` {#bootstrappers}
|
||||
|
||||
Features are similar to bootstrappers, but they are executed regardless of whether tenancy has been initialized or not. Their purpose is to provide additional functionality beyond what is necessary for the package to work. Things like easy redirects to tenant domains, tags in Telescope, etc.
|
||||
[Features]({{ $page->link('optional-features') }}) are similar to bootstrappers, but they are executed regardless of whether tenancy has been initialized or not. Their purpose is to provide additional functionality beyond what is necessary for the package to work. Things like easy redirects to tenant domains, tags in Telescope, etc.
|
||||
|
||||
### `home_url` {#home-url}
|
||||
|
||||
|
|
|
|||
12
docs/source/v2/features.blade.md
Normal file
12
docs/source/v2/features.blade.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
title: Optional Features
|
||||
description: Optional Features
|
||||
extends: _layouts.documentation
|
||||
section: content
|
||||
---
|
||||
|
||||
# Optional Features {#optional-features}
|
||||
|
||||
Similarly to [TenancyBootstrappers]({{ $page->link('tenancy-bootstrappers') }}), `Features` are classes that provide extra functionality and can be enabled in the config. They're all disabled by default, because they're not critical to the core tenancy scaffolding.
|
||||
|
||||
You may enable and disable `Features` in the `tenancy.features` configuration.
|
||||
17
docs/source/v2/features/tenant-redirect.blade.md
Normal file
17
docs/source/v2/features/tenant-redirect.blade.md
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
title: Tenant Redirect
|
||||
description: Tenant Redirect
|
||||
extends: _layouts.documentation
|
||||
section: content
|
||||
---
|
||||
|
||||
# Tenant Redirect {#tenant-redirect}
|
||||
|
||||
> To enable this feature, uncomment the `Stancl\Tenancy\Features\TenantRedirect::class` line in your `tenancy.features` config.
|
||||
|
||||
A customer has signed up on your website, you have created a new tenant and now you want to redirect the customer to their website. You can use the `tenant()` method on Redirect, like this:
|
||||
|
||||
```php
|
||||
// tenant sign up controller
|
||||
return redirect()->route('dashboard')->tenant($domain);
|
||||
```
|
||||
12
docs/source/v2/features/timestamps.blade.md
Normal file
12
docs/source/v2/features/timestamps.blade.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
title: Timestamps
|
||||
description: Timestamps
|
||||
extends: _layouts.documentation
|
||||
section: content
|
||||
---
|
||||
|
||||
# Timestamps {#timestamps-redirect}
|
||||
|
||||
> To enable this feature, uncomment the `Stancl\Tenancy\Features\Timestamps::class` line in your `tenancy.features` config.
|
||||
|
||||
TODO
|
||||
|
|
@ -7,17 +7,6 @@ section: content
|
|||
|
||||
# Miscellaneous Tips {#misc-tips}
|
||||
|
||||
## Tenant Redirect {#tenant-redirect}
|
||||
|
||||
> To enable this feature, uncomment the `Stancl\Tenancy\Features\TenantRedirect::class` line in your `tenancy.features` config.
|
||||
|
||||
A customer has signed up on your website, you have created a new tenant and now you want to redirect the customer to their website. You can use the `tenant()` method on Redirect, like this:
|
||||
|
||||
```php
|
||||
// tenant sign up controller
|
||||
return redirect()->route('dashboard')->tenant($domain);
|
||||
```
|
||||
|
||||
## Custom ID scheme
|
||||
|
||||
If you don't want to use UUIDs and want to use something more human-readable (even domain concatenated with uuid, for example), you can create a custom class for this:
|
||||
|
|
|
|||
|
|
@ -51,6 +51,6 @@ If you're coming from 1.x, it's recommended to read (or at least skim through) t
|
|||
|
||||
## New Features
|
||||
|
||||
- [Tenant Config]({{ $page->link('tenant-config') }})
|
||||
- [Tenant Config]({{ $page->link('features/tenant-config') }})
|
||||
- [Migrate Fresh]({{ $page->link('console-commands#migrate-fresh') }})
|
||||
- [`tenants:create`]({{ $page->link('console-commands#create-tenant') }})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue