Skip to content

Commit 9172913

Browse files
committed
Move items out of testbech to install command itself.
1 parent 728de7f commit 9172913

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

src/Commands/InstallCommand.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Cachet\Commands;
44

5+
use Cachet\Database\Seeders\DatabaseSeeder;
56
use Cachet\Settings\AppSettings;
67
use Cachet\Settings\Attributes\Description;
78
use Illuminate\Console\Command;
@@ -28,17 +29,29 @@ public function handle(AppSettings $settings)
2829

2930
if (confirm('Do you want to configure Cachet before installing?', true)) {
3031
info('Configuring Cachet...');
31-
$this->configureDatabaseSettings($settings);
32+
$this->configureEnvironmentSettings();
33+
$settings = $this->configureDatabaseSettings($settings);
3234
}
3335

3436
info('Installing Cachet...');
3537

38+
$this->call('filament:assets');
39+
40+
$this->call('migrate', ['--seed' => true, '--seeder' => DatabaseSeeder::class]);
41+
42+
$settings->save();
43+
3644
info('Cachet is installed ⚡');
3745

3846
return Command::SUCCESS;
3947
}
4048

41-
protected function configureDatabaseSettings(AppSettings $settings): void
49+
protected function configureEnvironmentSettings(): void
50+
{
51+
//@todo configure environment variables inside cachet.php
52+
}
53+
54+
protected function configureDatabaseSettings(AppSettings $settings): AppSettings
4255
{
4356
collect(
4457
(new ReflectionClass($settings))->getProperties(ReflectionProperty::IS_PUBLIC)
@@ -55,6 +68,6 @@ protected function configureDatabaseSettings(AppSettings $settings): void
5568
})
5669
->pluck('name');
5770

58-
$settings->save();
71+
return $settings;
5972
}
6073
}

testbench.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,8 @@ workbench:
1818
to: public/vendor/cachethq/cachet
1919
build:
2020
- asset-publish
21-
- filament:assets
2221
- create-sqlite-db
2322
- db:wipe
24-
- migrate:refresh:
25-
--seed: true
26-
--seeder: Cachet\Database\Seeders\DatabaseSeeder
2723
- cachet:install
2824
assets:
2925
- query-builder-config

0 commit comments

Comments
 (0)