|
3 | 3 | use NiftyCo\Skeletor\Skeletor; |
4 | 4 |
|
5 | 5 | return function (Skeletor $skeletor) { |
6 | | - // Prompt the user for the application name |
7 | 6 | $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()); |
8 | 13 |
|
9 | 14 | // If the user entered a name, replace the APP_NAME value in the .env file |
10 | 15 | if ($name) { |
11 | 16 | $skeletor->pregReplaceInFile('/^APP_NAME=(.*)$/m', 'APP_NAME='.$name, '.env'); |
12 | 17 | } |
13 | 18 |
|
14 | | - // Prompt the user for the demo user email |
15 | | - $email = $skeletor-> text( 'Enter the demo email:', '[email protected]'); |
16 | | - |
17 | 19 | // If the user entered an email, replace the DEFAULT_USER_EMAIL value in the .env file |
18 | 20 | if ($email) { |
19 | 21 | $skeletor->pregReplaceInFile('/^DEFAULT_USER_EMAIL=(".*?"|[^"\s]*|)$/m', 'DEFAULT_USER_EMAIL='.$email, '.env'); |
20 | 22 | } |
21 | 23 |
|
22 | | - // Prompt the user for the demo user password |
23 | | - $password = $skeletor->password('Enter the demo password:', 'password'); |
24 | | - |
25 | 24 | // If the user entered a password, replace the DEFAULT_USER_PASSWORD value in the .env file |
26 | 25 | if ($password) { |
27 | 26 | $skeletor->pregReplaceInFile('/^DEFAULT_USER_PASSWORD=(".*?"|[^"\s]*|)$/m', 'DEFAULT_USER_PASSWORD='.$password, '.env'); |
28 | 27 | } |
29 | 28 |
|
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 | | - |
38 | 29 | // If the user entered a timezone, replace the APP_TIMEZONE value in the .env file |
39 | 30 | if ($timezone) { |
40 | 31 | $skeletor->pregReplaceInFile('/^APP_TIMEZONE=(".*?"|[^"\s]*|)$/m', 'APP_TIMEZONE='.$timezone, '.env'); |
|
0 commit comments