Skip to content

Commit 6143a59

Browse files
committed
wip
Signed-off-by: Mior Muhammad Zaki <[email protected]>
1 parent 0c9aae5 commit 6143a59

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/DevToolServiceProvider.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
use Laravel\Nova\Console\FilterCommand;
1111
use Laravel\Nova\Console\LensCommand;
1212
use Laravel\Nova\Console\ResourceCommand;
13-
use Orchestra\Workbench\Console\InstallCommand;
1413
use Orchestra\Workbench\Events\InstallEnded;
1514
use Orchestra\Workbench\Events\InstallStarted;
15+
use Orchestra\Workbench\Workbench;
1616

1717
use function Illuminate\Filesystem\join_paths;
1818

@@ -34,7 +34,8 @@ public function register()
3434
]);
3535

3636
if (defined('TESTBENCH_WORKING_PATH')) {
37-
InstallCommand::$configurationBaseFile = join_paths(__DIR__, '..', 'stubs', 'testbench.stub');
37+
Workbench::swapFile('config', join_paths(__DIR__, '..', '..', 'stubs', 'testbench.stub'));
38+
Workbench::swapFile('seeders.database', join_paths(__DIR__, '..', '..', 'stubs', 'DatabaseSeeder.stub'));
3839

3940
$this->registerActionCommand();
4041
$this->registerBaseResourceCommand();

src/Listeners/InstallingWorkbench.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
use Illuminate\Contracts\Console\Kernel as ConsoleKernel;
66
use Illuminate\Filesystem\Filesystem;
77
use Orchestra\Workbench\Events\InstallStarted;
8+
use Orchestra\Workbench\Workbench;
89
use RuntimeException;
910

11+
use function Orchestra\Testbench\join_paths;
12+
1013
class InstallingWorkbench
1114
{
1215
/**
@@ -30,6 +33,9 @@ public function handle(InstallStarted $event)
3033
throw new RuntimeException('Nova Devtool does not support installation with --basic` option');
3134
}
3235

36+
Workbench::swapFile('config', join_paths(__DIR__, '..', '..', 'stubs', 'testbench.stub'));
37+
Workbench::swapFile('seeders.database', join_paths(__DIR__, '..', '..', 'stubs', 'DatabaseSeeder.stub'));
38+
3339
$this->kernel->call('make:user-model');
3440
$this->kernel->call('make:user-factory');
3541
}

0 commit comments

Comments
 (0)