From 375dba0a919ece989a66fb7d65a135e8928ec621 Mon Sep 17 00:00:00 2001 From: Flavio Medeiros Date: Fri, 14 Jan 2022 23:38:02 -0300 Subject: [PATCH] Refactored equal to conatins on Base Command --- src/Commands/BaseCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Commands/BaseCommand.php b/src/Commands/BaseCommand.php index 555f45d..d565957 100644 --- a/src/Commands/BaseCommand.php +++ b/src/Commands/BaseCommand.php @@ -127,11 +127,11 @@ protected function getSeederNamespace() { $composerJsonPath = base_path('composer.json'); $composerConfig = json_decode(file_get_contents($composerJsonPath), true); - $relativeSeederPath = str_replace($this->laravel->databasePath() . DIRECTORY_SEPARATOR, '', $this->getSeederFolder()); + $seederConfigPath = config('seedonce.folder_seeder'); if ((float) app()->version() >= 8) { - $items = array_filter($composerConfig['autoload']['psr-4'], function ($item) use ($relativeSeederPath) { - return $item === $relativeSeederPath; + $items = array_filter($composerConfig['autoload']['psr-4'], function ($item) use ($seederConfigPath) { + return Str::contains($item, $seederConfigPath); }); return array_keys($items)[0] ?? '';