forked from ARCANEDEV/LogViewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelpers.php
60 lines (55 loc) · 1.29 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
57
58
59
60
<?php
if ( ! function_exists('log_viewer')) {
/**
* Get the LogViewer instance.
*
* @return \Arcanedev\LogViewer\Contracts\LogViewerInterface
*/
function log_viewer() {
return app('arcanedev.log-viewer');
}
}
if ( ! function_exists('log_levels')) {
/**
* Get the LogLevels instance.
*
* @return \Arcanedev\LogViewer\Contracts\LogLevelsInterface
*/
function log_levels() {
return app('arcanedev.log-viewer.levels');
}
}
if ( ! function_exists('log_menu')) {
/**
* Get the LogMenu instance.
*
* @return \Arcanedev\LogViewer\Contracts\LogMenuInterface
*/
function log_menu() {
return app('arcanedev.log-viewer.menu');
}
}
if ( ! function_exists('log_styler')) {
/**
* Get the LogStyler instance.
*
* @return \Arcanedev\LogViewer\Contracts\LogStylerInterface
*/
function log_styler() {
return app('arcanedev.log-viewer.styler');
}
}
if ( ! function_exists('extract_date')) {
/**
* Extract date from string (format : YYYY-MM-DD).
*
* @param string $string
*
* @return string
*/
function extract_date($string) {
return preg_replace(
'/.*(' . REGEX_DATE_PATTERN . ').*/', '$1', $string
);
}
}