|
6 | 6 | $skeletor->intro('Welcome to Larament setup! Let\'s get started.'); |
7 | 7 |
|
8 | 8 | $applicationName = $skeletor->text('What is the application name?', 'Laravel', required: true); |
| 9 | + |
9 | 10 | $applicationDescription = $skeletor->text('What is the application description?', 'A cool Laravel application'); |
| 11 | + |
10 | 12 | $timezone = $skeletor->search( |
11 | 13 | 'Which timezone would you like to use?', |
12 | 14 | fn (string $query) => collect(timezone_identifiers_list()) |
|
18 | 20 | $skeletor->intro('Let\'s setup the default user that will be created.'); |
19 | 21 |
|
20 | 22 | $name = $skeletor->text('What is the demo username?', 'John Doe', required: true); |
| 23 | + |
21 | 24 | $email = $skeletor-> text( 'What is the demo email?', '[email protected]', required: true); |
| 25 | + |
22 | 26 | $password = $skeletor->password('What is the demo password?', 'password', required: true); |
23 | 27 |
|
24 | | - // If the user entered a name, replace the APP_NAME value in the .env file |
25 | 28 | if ($applicationName) { |
26 | 29 | $skeletor->pregReplaceInFile('/^APP_NAME=(.*)$/m', 'APP_NAME="'.$applicationName.'"', '.env'); |
27 | 30 | } |
28 | 31 |
|
29 | | - // If the user entered a description, replace the description value in the composer.json file |
30 | 32 | if ($applicationDescription) { |
31 | 33 | $skeletor->pregReplaceInFile( |
32 | 34 | '/"description":\s*".*?"/', |
|
35 | 37 | ); |
36 | 38 | } |
37 | 39 |
|
38 | | - // If the user entered a name, replace the DEFAULT_USER_NAME value in the .env file |
39 | 40 | if ($name) { |
40 | 41 | $skeletor->pregReplaceInFile('/^DEFAULT_USER_NAME=(".*?"|[^"\s]*|)$/m', 'DEFAULT_USER_NAME="'.$name.'"', '.env'); |
41 | 42 | } |
42 | 43 |
|
43 | | - // If the user entered an email, replace the DEFAULT_USER_EMAIL value in the .env file |
44 | 44 | if ($email) { |
45 | 45 | $skeletor->pregReplaceInFile('/^DEFAULT_USER_EMAIL=(".*?"|[^"\s]*|)$/m', 'DEFAULT_USER_EMAIL="'.$email.'"', '.env'); |
46 | 46 | } |
47 | 47 |
|
48 | | - // If the user entered a password, replace the DEFAULT_USER_PASSWORD value in the .env file |
49 | 48 | if ($password) { |
50 | 49 | $skeletor->pregReplaceInFile('/^DEFAULT_USER_PASSWORD=(".*?"|[^"\s]*|)$/m', 'DEFAULT_USER_PASSWORD="'.$password.'"', '.env'); |
51 | 50 | } |
52 | 51 |
|
53 | | - // If the user entered a timezone, replace the APP_TIMEZONE value in the .env file |
54 | 52 | if ($timezone) { |
55 | 53 | $skeletor->pregReplaceInFile('/^APP_TIMEZONE=(".*?"|[^"\s]*|)$/m', 'APP_TIMEZONE="'.$timezone.'"', '.env'); |
56 | 54 | } |
|
0 commit comments