mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-04 21:14:02 +00:00
Misc tips
This commit is contained in:
parent
a7dd6a5c84
commit
3e5d4ad7b8
2 changed files with 35 additions and 0 deletions
|
|
@ -44,6 +44,7 @@ return [
|
||||||
'Tips' => [
|
'Tips' => [
|
||||||
'children' => [
|
'children' => [
|
||||||
'HTTPS Certificates' => 'docs/https-certificates',
|
'HTTPS Certificates' => 'docs/https-certificates',
|
||||||
|
'Misc' => 'docs/misc-tips',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'Stay Updated' => 'docs/stay-updated',
|
'Stay Updated' => 'docs/stay-updated',
|
||||||
|
|
|
||||||
34
source/docs/misc-tips.md
Normal file
34
source/docs/misc-tips.md
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
---
|
||||||
|
title: Miscellaneous Tips
|
||||||
|
description: Miscellaneous Tips | stancl/tenancy — A Laravel multi-database tenancy package that respects your code..
|
||||||
|
extends: _layouts.documentation
|
||||||
|
section: content
|
||||||
|
---
|
||||||
|
|
||||||
|
# Miscellaneous Tips {#misc-tips}
|
||||||
|
|
||||||
|
## Tenant Redirect {#tenant-redirect}
|
||||||
|
|
||||||
|
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($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:
|
||||||
|
|
||||||
|
```php
|
||||||
|
class MyUniqueIDGenerator implements UniqueIdentifierGenerator
|
||||||
|
{
|
||||||
|
public static function handle(string $domain, array $data): string
|
||||||
|
{
|
||||||
|
return $domain . \Webpatser\Uuid\Uuid::generate(1, $domain);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
and then set the `tenancy.unique_id_generator` config to the full path to your class.
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue