Skip to content

Commit

Permalink
Use class notation
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrooksuk committed Feb 1, 2019
1 parent 98b213b commit ce9a732
Showing 1 changed file with 9 additions and 24 deletions.
33 changes: 9 additions & 24 deletions app/Console/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Dotenv\Exception\InvalidPathException;
use Illuminate\Console\Command;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Contracts\Console\Kernel;

/**
* This is the install command class.
Expand Down Expand Up @@ -71,9 +72,9 @@ public function handle()
$this->configureDrivers();
$this->configureMail();
$this->configureCachet();
$this->configureUser();
}

<<<<<<< HEAD
$this->line('Installing Cachet...');

$this->events->fire('command.installing', $this);
Expand All @@ -87,15 +88,6 @@ public function handle()
$this->events->fire('command.linkstorage', $this);
$this->events->fire('command.extrastuff', $this);
$this->events->fire('command.installed', $this);
=======
$this->configureEnvironmentFile();
$this->configureKey();
$this->configureDatabase();
$this->configureDrivers();
$this->configureMail();
$this->configureCachet();
$this->configureUser();
>>>>>>> Add user on cachet install command

$this->info('Cachet is installed ⚡');
}
Expand Down Expand Up @@ -150,15 +142,9 @@ protected function configureDatabase(array $default = [])
], $default);

$config['DB_DRIVER'] = $this->choice('Which database driver do you want to use?', [
<<<<<<< HEAD
'mysql' => 'MySQL',
'pgsql' => 'PostgreSQL',
'sqlite' => 'SQLite',
=======
'mysql' => 'MySQL',
'pgsql' => 'PostgreSQL',
'sqlite' => 'SQLite',
>>>>>>> Add user on cachet install command
], $config['DB_DRIVER']);

if ($config['DB_DRIVER'] === 'sqlite') {
Expand Down Expand Up @@ -329,7 +315,7 @@ protected function configureMail(array $config = [])

/**
* Configure Cachet.
*
*
* @param array $config
*
* @return void
Expand All @@ -352,7 +338,7 @@ protected function configureCachet(array $config = [])
}

/**
* Configure the fisrt user.
* Configure the first user.
*
* @return void
*/
Expand All @@ -364,17 +350,17 @@ protected function configureUser()

// We need to refresh the config to get access to the newly connected database.
$this->getFreshConfiguration();

// Now we need to install the application.
$this->call('app:install');

// $this->call('cachet:install');
$user = [
'username' => $this->ask('Please enter your username'),
'email' => $this->ask('Please enter your email'),
'password' => $this->secret('Please enter your password'),
'level' => User::LEVEL_ADMIN,
];

User::create($user);
}

Expand Down Expand Up @@ -426,8 +412,7 @@ protected function formatConfigsTable(array $config)
protected function getFreshConfiguration()
{
$app = require $this->laravel->bootstrapPath().'/app.php';

$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
$app->make(Kernel::class)->bootstrap();
}

/**
Expand Down

0 comments on commit ce9a732

Please sign in to comment.