helper.php 694 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * This file is part of the "laravel-lang/publisher" project.
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. *
  8. * @author Andrey Helldar <helldar@dragon-code.pro>
  9. * @copyright 2023 Laravel Lang Team
  10. * @license MIT
  11. *
  12. * @see https://laravel-lang.com
  13. */
  14. declare(strict_types=1);
  15. if (! function_exists('lang_path')) {
  16. function lang_path(string $path = ''): string
  17. {
  18. $directory = is_dir(base_path('resources/lang'))
  19. ? base_path('resources/lang')
  20. : base_path('lang');
  21. return $directory . (! empty($path) ? DIRECTORY_SEPARATOR . $path : '');
  22. }
  23. }