diff --git a/.env.example b/.env.example index e710496ca..c3e5febd2 100644 --- a/.env.example +++ b/.env.example @@ -4,9 +4,10 @@ APP_VERSION=1.0.0 APP_KEY= APP_DEBUG=true APP_URL=http://localhost -APP_TIMEZONE='Asia/Kolkata' +APP_TIMEZONE= +APP_LOCALE= LOG_CHANNEL=stack -APP_CURRENCY=USD +APP_CURRENCY= DB_CONNECTION=mysql DB_HOST=127.0.0.1 diff --git a/app/Console/Commands/install.php b/app/Console/Commands/install.php index b1c2b3380..f8de6663f 100644 --- a/app/Console/Commands/install.php +++ b/app/Console/Commands/install.php @@ -91,17 +91,30 @@ class install extends Command File::copy('.env.example', '.env'); Artisan::call('key:generate'); $this->envUpdate('APP_URL=http://localhost', ':8000'); + + $locale = $this->choice('Please select the default locale or press enter to continue', ['ar', 'en', 'fa', 'nl', 'pt_BR'], 1); + $this->envUpdate('APP_LOCALE=', $locale); + + $TimeZones = timezone_identifiers_list(); + $timezone = $this->anticipate('Enter the default timezone', $TimeZones, date_default_timezone_get()); + $this->envUpdate('APP_TIMEZONE=', $timezone); + + $currency = $this->choice('Enter the default currency', ['USD', 'EUR'], 'USD'); + $this->envUpdate('APP_CURRENCY=', $currency); + + $this->addDatabaseDetails(); } catch (\Exception $e) { - $this->error('Error in creating .env file, please create manually and then run `php artisan migrate` again'); + $this->error('Error in creating .env file, please create it manually and then run `php artisan migrate` again'); } } public function addDatabaseDetails() { - $dbName = $this->ask('What is your database name to be used by bagisto'); + $dbName = $this->ask('What is the database name to be used by bagisto'); $dbUser = $this->anticipate('What is your database username', ['root']); $dbPass = $this->secret('What is your database password'); + $this->envUpdate('DB_DATABASE=', $dbName); $this->envUpdate('DB_USERNAME=', $dbUser); $this->envUpdate('DB_PASSWORD=', $dbPass); diff --git a/config/app.php b/config/app.php index 3a6ec6903..d86b5d4b2 100755 --- a/config/app.php +++ b/config/app.php @@ -78,7 +78,7 @@ return [ | */ - 'locale' => 'en', + 'locale' => env('APP_LOCALE', 'en'), /* |--------------------------------------------------------------------------