From ef705fe574247aa2cd5c52b03aeaa768fb91c9e3 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Sat, 14 Dec 2024 20:13:00 +0800 Subject: [PATCH] wip Signed-off-by: Mior Muhammad Zaki --- src/Console/InstallCommand.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php index 7a58a42..30e28d3 100644 --- a/src/Console/InstallCommand.php +++ b/src/Console/InstallCommand.php @@ -91,15 +91,22 @@ protected function copyTestbenchConfigurationFile(Filesystem $filesystem, string force: (bool) $this->option('force'), ))->handle($from, $to); + $serviceProvider = \sprintf('%sProviders\WorkbenchServiceProvider', Workbench::detectNamespace('app', force: true) ?? 'Workbench\App\\'); + $databaseSeeder = \sprintf('%sDatabaseSeeder', Workbench::detectNamespace('database/seeders', force: true) ?? 'Workbench\Database\Seeders\\'); + $this->replaceInFile( $filesystem, [ + '{{ WorkbenchServiceProvider }}', 'Workbench\App\Providers\WorkbenchServiceProvider', + '{{ WorkbenchDatabaseSeeder }}', 'Workbench\Database\Seeders\DatabaseSeeder', ], [ - \sprintf('%sProviders\WorkbenchServiceProvider', Workbench::detectNamespace('app', force: true) ?? 'Workbench\App\\'), - \sprintf('%sDatabaseSeeder', Workbench::detectNamespace('database/seeders', force: true) ?? 'Workbench\Database\Seeders\\'), + $serviceProvider, + $serviceProvider, + $databaseSeeder, + $databaseSeeder, ], $to );