Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Aug 24, 2024
1 parent ac39e52 commit e659175
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions app/system/console/commands/IgniterInstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,30 +145,28 @@ protected function setSeederProperties()
DatabaseSeeder::$siteUrl = $this->ask('Site URL', Config::get('app.url'));

DatabaseSeeder::$seedDemo = $this->confirm('Install demo data?', DatabaseSeeder::$seedDemo);

DatabaseSeeder::$siteEmail = $this->ask('Admin Email', DatabaseSeeder::$siteEmail);
DatabaseSeeder::$staffName = $this->ask('Admin Name', DatabaseSeeder::$staffName);
}

protected function createSuperUser()
{
$email = $this->output->ask('Admin Email', DatabaseSeeder::$siteEmail, function ($answer) {
$staffName = $this->ask('Admin Name', DatabaseSeeder::$staffName);
$email = $this->output->ask('Admin Email', DatabaseSeeder::$siteEmail, function($answer) {
if (Staffs_model::whereStaffEmail($answer)->first()) {
throw new \RuntimeException('An administrator with that email already exists, please choose a different email.');
}

return $answer;
});

$username = $this->output->ask('Admin Username', 'admin', function ($answer) {
$username = $this->output->ask('Admin Username', 'admin', function($answer) {
if (Users_model::whereUsername($answer)->first()) {
throw new \RuntimeException('An administrator with that username already exists, please choose a different username.');
}

return $answer;
});

$password = $this->output->ask('Admin Password', '123456', function ($answer) {
$password = $this->output->ask('Admin Password', '123456', function($answer) {
if (!is_string($answer) || strlen($answer) < 6 || strlen($answer) > 32) {
throw new \RuntimeException('Please specify the administrator password, at least 6 characters and not more than 32 characters.');
}
Expand All @@ -178,7 +176,7 @@ protected function createSuperUser()

$user = AdminAuth::register([
'staff_email' => $email,
'staff_name' => DatabaseSeeder::$staffName,
'staff_name' => $staffName,
'language_id' => Languages_model::first()->language_id,
'staff_role_id' => Staff_roles_model::first()->staff_role_id,
'staff_status' => true,
Expand Down

0 comments on commit e659175

Please sign in to comment.