Skip to content

Commit

Permalink
Merge branch '7.x' into 8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Dec 16, 2024
2 parents 7aa6b5e + 4d91282 commit 06aea15
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,38 @@ 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\\');
$workbenchAppNamespacePrefix = Workbench::detectNamespace('app', force: true) ?? 'Workbench\App\\';
$workbenchSeederNamespacePrefix = Workbench::detectNamespace('database/seeders', force: true) ?? 'Workbench\Database\Seeders\\';

$serviceProvider = \sprintf('%sProviders\WorkbenchServiceProvider', $workbenchAppNamespacePrefix);
$databaseSeeder = \sprintf('%sDatabaseSeeder', $workbenchSeederNamespacePrefix);

$filesystem->replaceInFile(
[
'{{WorkbenchAppNamespace}}',
'{{ WorkbenchAppNamespace }}',
'{{WorkbenchSeederNamespace}}',
'{{ WorkbenchSeederNamespace }}',

'{{WorkbenchServiceProvider}}',
'{{ WorkbenchServiceProvider }}',
'Workbench\App\Providers\WorkbenchServiceProvider',

'{{WorkbenchDatabaseSeeder}}',
'{{ WorkbenchDatabaseSeeder }}',
'Workbench\Database\Seeders\DatabaseSeeder',
],
[
$workbenchAppNamespacePrefix,
$workbenchAppNamespacePrefix,
$workbenchSeederNamespacePrefix,
$workbenchSeederNamespacePrefix,

$serviceProvider,
$serviceProvider,
$serviceProvider,

$databaseSeeder,
$databaseSeeder,
$databaseSeeder,
],
Expand Down

0 comments on commit 06aea15

Please sign in to comment.