From adbf3d8e81e59f27cf3adf903129b1978e95a801 Mon Sep 17 00:00:00 2001 From: yaza Date: Mon, 5 Sep 2022 10:34:28 +0800 Subject: [PATCH] fixing bug on windows slash directory --- src/RepositoryServiceProvider.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/RepositoryServiceProvider.php b/src/RepositoryServiceProvider.php index 86ea65f..3e71f2e 100644 --- a/src/RepositoryServiceProvider.php +++ b/src/RepositoryServiceProvider.php @@ -125,6 +125,7 @@ private function getRepositoryPath() $dirs = File::directories($this->app->basePath() . "/" . config("easy-repository.repository_directory")); foreach ($dirs as $dir) { + $dir = str_replace('\\', '/', $dir); $arr = explode("/", $dir); $folders[] = end($arr); @@ -201,7 +202,9 @@ private function getServicePath() { foreach ($path as $file) { - $servicePath[] = str_replace("Services/","",strstr($file->getPath(), "Services")); + $file_path = strstr($file->getPath(), "Services"); + $file_path = str_replace('\\', '/', $file_path); + $servicePath[] = str_replace("Services/","",$file_path); } }