forked from ARCANEDEV/LogViewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
helpers.php
65 lines (59 loc) · 1.34 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
61
62
63
64
65
<?php
use Arcanedev\LogViewer\Contracts;
if ( ! function_exists('log_viewer')) {
/**
* Get the LogViewer instance.
*
* @return Arcanedev\LogViewer\Contracts\LogViewer
*/
function log_viewer()
{
return app(Contracts\LogViewer::class);
}
}
if ( ! function_exists('log_levels')) {
/**
* Get the LogLevels instance.
*
* @return Arcanedev\LogViewer\Contracts\Utilities\LogLevels
*/
function log_levels()
{
return app(Contracts\Utilities\LogLevels::class);
}
}
if ( ! function_exists('log_menu')) {
/**
* Get the LogMenu instance.
*
* @return Arcanedev\LogViewer\Contracts\Utilities\LogMenu
*/
function log_menu()
{
return app(Contracts\Utilities\LogMenu::class);
}
}
if ( ! function_exists('log_styler')) {
/**
* Get the LogStyler instance.
*
* @return Arcanedev\LogViewer\Contracts\Utilities\LogStyler
*/
function log_styler()
{
return app(Contracts\Utilities\LogStyler::class);
}
}
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);
}
}