-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathhelpers.php
36 lines (32 loc) · 871 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
<?php
if (! function_exists('module_path')) {
function module_path($name, $path = ''): string
{
$module = app('modules')->findOrFail($name);
return $module->getPath() . ($path ? DIRECTORY_SEPARATOR . $path : $path);
}
}
if (! function_exists('config_path')) {
/**
* Get the configuration path.
*
* @param string $path
* @return string
*/
function config_path($path = '')
{
return app()->basePath() . '/config' . ($path ? DIRECTORY_SEPARATOR . $path : $path);
}
}
if (! function_exists('public_path')) {
/**
* Get the path to the public folder.
*
* @param string $path
* @return string
*/
function public_path($path = '')
{
return app()->make('path.public') . ($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path);
}
}