-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelpers.php
52 lines (44 loc) · 913 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
if (!function_exists('uuid4')) {
/**
* @return string
*/
function uuid4()
{
return \Ramsey\Uuid\Uuid::uuid4()->toString();
}
}
if (!function_exists('datetime')) {
/**
* @param string $time
* @param string $format
*
* @return string
*/
function datetime($time = 'now', $format = DateTime::ISO8601)
{
return (new DateTime($time))->format($format);
}
}
if (!function_exists('base_path')) {
/**
* @param string $path
*
* @return string
*/
function base_path(string $path = '')
{
return __DIR__ . DIRECTORY_SEPARATOR . $path;
}
}
if (!function_exists('app_path')) {
/**
* @param string $path
*
* @return string
*/
function app_path(string $path = '')
{
return __DIR__ . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . $path;
}
}