-
Notifications
You must be signed in to change notification settings - Fork 32
/
helpers.php
56 lines (47 loc) · 1.33 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
if (! function_exists('on_route')) {
function on_route($route)
{
return Route::current() ? Route::is($route) : false;
}
}
if (! function_exists('locale')) {
function locale($locale = null)
{
if (is_null($locale)) {
return app()->getLocale();
}
app()->setLocale($locale);
return app()->getLocale();
}
}
if (! function_exists('is_module_enabled')) {
function is_module_enabled($module)
{
return array_key_exists($module, app('modules')->enabled());
}
}
if (! function_exists('is_core_module')) {
function is_core_module($module)
{
return in_array(strtolower($module), app('asgard.ModulesList'));
}
}
if (! function_exists('is_core_theme')) {
function is_core_theme(string $theme)
{
return in_array($theme, ['AdminLTE', 'Flatly'], false);
}
}
if (! function_exists('asgard_i18n_editor')) {
function asgard_i18n_editor($fieldName, $labelName, $content, $lang)
{
return view('core::components.i18n.textarea-wrapper', compact('fieldName', 'labelName', 'content', 'lang'));
}
}
if (! function_exists('asgard_editor')) {
function asgard_editor($fieldName, $labelName, $content)
{
return view('core::components.textarea-wrapper', compact('fieldName', 'labelName', 'content'));
}
}