From dcd7a47f2ea09de83fff354ca6fb30f7c94377e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Wed, 18 Sep 2019 15:45:39 +0200 Subject: [PATCH] 2.x creating tenants --- config.php | 5 +++++ source/2.x/creating-tenants.blade.md | 13 +++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/config.php b/config.php index 08dfe4d..697010e 100644 --- a/config.php +++ b/config.php @@ -6,6 +6,11 @@ return [ 'siteName' => 'stancl/tenancy documentation', 'siteDescription' => 'A Laravel multi-database tenancy package that respects your code.', + // key => display text + 'versions' => [ + '1.x' => '1.x', + '2.x' => '2.x (beta)', + ], 'defaultVersion' => '2.x', 'prettyUrls' => true, diff --git a/source/2.x/creating-tenants.blade.md b/source/2.x/creating-tenants.blade.md index bdc7618..d17d487 100644 --- a/source/2.x/creating-tenants.blade.md +++ b/source/2.x/creating-tenants.blade.md @@ -17,14 +17,15 @@ Tenant::new()->withDomains(['tenant1.yourapp.com'])->withData(['plan' => 'free'] > Tip: All domains under `.localhost` are routed to 127.0.0.1 on most operating systems. This is useful for development. -If you want to set some data while creating the tenant, you can pass an array with the data as the second argument: +The `withDomains()` and `withData()` methods are optional. + +You can also create a tenant using the `Tenant::create` method: ```php -tenant()->create('tenant2.yourapp.com', [ - 'plan' => 'free' +$domains = ['tenant1.myapp.com', 'tenant1.com']; +Tenant::create($domains, [ + 'plan' => 'free', ]); ``` -The `create` method returns an array with tenant information (`uuid`, `domain` and whatever else you supplied). - -> Note: Creating a tenant doesn't run [migrations](https://stancl-tenancy.netlify.com/docs/console-commands/#migrate) automatically. You have to do that yourself. \ No newline at end of file +> Note: Creating a tenant doesn't run [migrations](https://stancl-tenancy.netlify.com/docs/console-commands/#migrate) automatically. You have to do that yourself. \ No newline at end of file