1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 10:14:04 +00:00
tenancy/source/docs/misc-tips.md
Samuel Štancl 59a3325f1d
[1.8.0][WIP] Update docs (#105)
* Add jobs & horizon pages

* Apply fixes from StyleCI

* Telescope integration

* Integrations page

* Apply fixes from StyleCI

* Add testing section

* Conflicting routes

* Misc tips

* Apply fixes from StyleCI
2019-08-23 22:43:02 +02:00

1.1 KiB

title description extends section
Miscellaneous Tips Miscellaneous Tips | stancl/tenancy — A Laravel multi-database tenancy package that respects your code.. _layouts.documentation content

Miscellaneous Tips

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:

// 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:

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.