From c353d38799e942e4b549edc8d624bc9943ee2f38 Mon Sep 17 00:00:00 2001 From: Riccardo Venturini Date: Sun, 12 Dec 2021 09:42:11 +0100 Subject: [PATCH] Remove backslash to \Models before add namespace that already has \ at the end. Fix to #21 --- src/Migrator/Pipes/FindModelsWithSettings.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Migrator/Pipes/FindModelsWithSettings.php b/src/Migrator/Pipes/FindModelsWithSettings.php index 81eddc1..4a6ae83 100644 --- a/src/Migrator/Pipes/FindModelsWithSettings.php +++ b/src/Migrator/Pipes/FindModelsWithSettings.php @@ -86,6 +86,7 @@ protected function findModelsWithSettings(): Generator ->ltrim('app\\') ->rtrim('.php') ->replace(DIRECTORY_SEPARATOR, '\\') + ->ltrim('\\') ->start('\\'.$namespace); try { @@ -114,4 +115,4 @@ protected function findModelsWithSettings(): Generator yield new $className; } } -} \ No newline at end of file +}