Skip to content

Commit 5903b29

Browse files
Update Skeletorfile with prompts for email, password, and timezone
1 parent 5b68353 commit 5903b29

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

Skeletorfile.php

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,29 @@
33
use NiftyCo\Skeletor\Skeletor;
44

55
return function (Skeletor $skeletor) {
6-
// Prompt the user for the application name
76
$name = $skeletor->text('Enter the application name:', 'Laravel');
7+
$email = $skeletor->text('Enter the demo email:', '[email protected]');
8+
$password = $skeletor->password('Enter the demo password:', 'password');
9+
$timezone = $skeletor->search('Which timezone do you want to use? ', fn($query) => collect(timezone_identifiers_list())
10+
->filter(fn($timezone) => str_contains(strtolower($timezone), strtolower($query)))
11+
->values()
12+
->all());
813

914
// If the user entered a name, replace the APP_NAME value in the .env file
1015
if ($name) {
1116
$skeletor->pregReplaceInFile('/^APP_NAME=(.*)$/m', 'APP_NAME='.$name, '.env');
1217
}
1318

14-
// Prompt the user for the demo user email
15-
$email = $skeletor->text('Enter the demo email:', '[email protected]');
16-
1719
// If the user entered an email, replace the DEFAULT_USER_EMAIL value in the .env file
1820
if ($email) {
1921
$skeletor->pregReplaceInFile('/^DEFAULT_USER_EMAIL=(".*?"|[^"\s]*|)$/m', 'DEFAULT_USER_EMAIL='.$email, '.env');
2022
}
2123

22-
// Prompt the user for the demo user password
23-
$password = $skeletor->password('Enter the demo password:', 'password');
24-
2524
// If the user entered a password, replace the DEFAULT_USER_PASSWORD value in the .env file
2625
if ($password) {
2726
$skeletor->pregReplaceInFile('/^DEFAULT_USER_PASSWORD=(".*?"|[^"\s]*|)$/m', 'DEFAULT_USER_PASSWORD='.$password, '.env');
2827
}
2928

30-
// Prompt the user for the application locale
31-
$timezone = $skeletor->search('Which timezone do you want to use? ', function ($query) {
32-
return collect(timezone_identifiers_list())
33-
->filter(fn ($timezone) => str_contains(strtolower($timezone), strtolower($query)))
34-
->values()
35-
->all();
36-
});
37-
3829
// If the user entered a timezone, replace the APP_TIMEZONE value in the .env file
3930
if ($timezone) {
4031
$skeletor->pregReplaceInFile('/^APP_TIMEZONE=(".*?"|[^"\s]*|)$/m', 'APP_TIMEZONE='.$timezone, '.env');

0 commit comments

Comments
 (0)