mtvbrianking /
laravel-ussd
| 1 | <?php |
||
| 2 | |||
| 3 | use Illuminate\Container\Container; |
||
| 4 | use Illuminate\Contracts\Config\Repository as ConfigRepository; |
||
| 5 | |||
| 6 | if (! function_exists('menu_path')) { |
||
| 7 | /** |
||
| 8 | * Get the path to the menus directory. |
||
| 9 | */ |
||
| 10 | function menu_path(string $path = ''): string |
||
| 11 | { |
||
| 12 | 49 | $app = Container::getInstance(); |
|
| 13 | |||
| 14 | 49 | $config = $app->make(ConfigRepository::class); |
|
| 15 | |||
| 16 | 49 | $menusDir = $config->get('ussd.menu-path'); |
|
| 17 | |||
| 18 | 49 | $path = $path ? DIRECTORY_SEPARATOR.ltrim($path, DIRECTORY_SEPARATOR) : $path; |
|
| 19 | |||
| 20 | 49 | return $app->basePath($menusDir.$path); |
|
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 21 | } |
||
| 22 | } |
||
| 23 |