forked from stancl/tenancy-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.php
59 lines (49 loc) · 2.22 KB
/
config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
use Illuminate\Support\Str;
return [
'baseUrl' => 'http://localhost:3000',
'production' => false,
'siteName' => 'Tenancy for Laravel',
'siteDescription' => 'Automatically turn any Laravel application multi-tenant — no code changes needed. stancl/tenancy automatically switches database connections and all other things in the background, letting you leverage standard Laravel code into a full SaaS application. Most features out of all multi-tenancy packages. Single & multi-database tenancy.',
'githubUrl' => 'https://github.com/stancl/tenancy',
'githubDocsUrl' => 'https://github.com/stancl/tenancy-docs',
// key => display name
'versions' => [
'v1' => '1.x',
'v2' => '2.x',
'v3' => '3.x',
],
'defaultVersion' => 'v3',
'prettyUrls' => true,
'version' => function ($page) {
return explode('/', $page->getPath())[2];
},
'link' => function ($page, $path) {
return $page->baseUrl . '/docs/' . $page->version() . '/' . $path . ($page->prettyUrls ? '' : '.html');
},
'editLink' => function ($page) {
return "{$page->githubDocsUrl}/edit/master/source/{$page->getRelativePath()}/{$page->getFilename()}.{$page->getExtension()}";
},
// Algolia DocSearch credentials
'docsearchApiKey' => '53c5eaf88e819535d98f4a179c1802e1',
'docsearchIndexName' => 'stancl-tenancy',
// navigation menu
'navigation' => require_once('navigation.php'),
// helpers
'isActive' => function ($page, $path) {
return Str::endsWith(trimPath($page->getPath()), trimPath($page->version() . '/' . $path));
},
'isActiveParent' => function ($page, $menuItem) {
if (is_object($menuItem) && $menuItem->children) {
return $menuItem->children->contains(function ($child) use ($page) {
return trimPath($page->getPath()) == trimPath($child);
});
}
},
'url' => function ($page, $path) {
return (Str::startsWith($path, 'http://') || Str::startsWith($path, 'https://')) ? $path : '/'.trimPath($path);
},
'isUrl' => function ($page, $path) {
return Str::startsWith($path, 'http://') || Str::startsWith($path, 'https://');
},
];