diff --git a/app/Console/Commands/Install.php b/app/Console/Commands/Install.php index d20be432..3c435c9c 100644 --- a/app/Console/Commands/Install.php +++ b/app/Console/Commands/Install.php @@ -7,7 +7,11 @@ use Illuminate\Console\Command; class Install extends Command { - protected $signature = 'phpvms:install {--update}'; + protected $signature = 'phpvms:install + {--update} + {--airline-name?} + {--airline-code?}'; + protected $description = 'Install or update phpVMS'; public function __construct() @@ -20,7 +24,11 @@ class Install extends Command $this->info('Installing phpVMS...'); $this->setupDatabase(); - $this->initialData(); + + # Only run these if we're doing an initial install + if(!$this->option('update')) { + $this->initialData(); + } } /** @@ -34,6 +42,7 @@ class Install extends Command $this->call('database:create'); } + $this->info('Running database migrations...'); $this->call('migrate:refresh'); # TODO: Call initial seed data, for the groups and other supporting data @@ -44,7 +53,17 @@ class Install extends Command */ protected function initialData() { - # TODO: Prompt for initial airline name + # TODO: Prompt for initial airline info + $airline_name = $this->option('airline-name'); + if(!$airline_name) { + $airline_name = $this->ask('Enter your airline name'); + } + + $airline_code = $this->option('airline-code'); + if(!$airline_code) { + $airline_code = $this->ask('Enter your airline code'); + } + # TODO: Prompt for admin user/password } }