-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathhelpers.php
37 lines (34 loc) · 893 Bytes
/
helpers.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
<?php
if (!function_exists('supportedJsonDb')) {
/**
* Supported database json data
* @return bool
*/
function supportedJsonDb(): bool
{
return app(\LeMaX10\MultiSite\Classes\Support\DatabaseSupport::class)
->supportJson();
}
}
if (!function_exists('currentSite')) {
/**
* Helper - get current site
* @return \LeMaX10\MultiSite\Classes\Contracts\Entities\Site|null
*/
function currentSite(): ?\LeMaX10\MultiSite\Classes\Contracts\Entities\Site
{
return app(\LeMaX10\MultiSite\Classes\Contracts\SiteManager::class)
->getCurrent();
}
}
if (!function_exists('siteId')) {
/**
* Helper - get current site id
* @return string|null
*/
function siteId(): ?string
{
return app(\LeMaX10\MultiSite\Classes\Contracts\SiteManager::class)
->id();
}
}