From 4389c7f870e25360c56940c625bbcc42fee2ff51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sel=C3=A7uk=20=C3=87ukur?= <5716652+selcukcukur@users.noreply.github.com> Date: Tue, 21 Jan 2025 01:35:02 +0300 Subject: [PATCH] [11.x] `addPath()` Allow adding new path for translation loader. (#54277) * It allows adding new directories with the `addLocation` method. * Update FileLoader.php * Update FileLoader.php * Update FileLoader.php --------- Co-authored-by: Taylor Otwell --- src/Illuminate/Translation/FileLoader.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Illuminate/Translation/FileLoader.php b/src/Illuminate/Translation/FileLoader.php index b324e7aaecc0..65c4c4abc323 100755 --- a/src/Illuminate/Translation/FileLoader.php +++ b/src/Illuminate/Translation/FileLoader.php @@ -182,6 +182,17 @@ public function namespaces() return $this->hints; } + /** + * Add a new path to the loader. + * + * @param string $path + * @return void + */ + public function addPath($path) + { + $this->paths[] = $path; + } + /** * Add a new JSON path to the loader. *