Skip to content

Commit c965b0b

Browse files
Add Skeletor configuration script for updating app details
1 parent 341080c commit c965b0b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Skeletorfile.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
use NiftyCo\Skeletor\Skeletor;
4+
5+
return function (Skeletor $skeletor) {
6+
// Update the application name
7+
$name = $skeletor->text('Enter the application name:', 'Laravel');
8+
9+
if ($name) {
10+
$skeletor->pregReplaceInFile('/^APP_NAME=(.*)$/m', 'APP_NAME='.$name, '.env');
11+
}
12+
13+
// Update the demo user email
14+
$email = $skeletor->text('Enter the demo email:', 'admin@example.com');
15+
16+
if ($email) {
17+
$skeletor->pregReplaceInFile('/^DEFAULT_USER_EMAIL=(".*?"|[^"\s]*|)$/m', 'DEFAULT_USER_EMAIL='.$email, '.env');
18+
}
19+
20+
// Update the demo user password
21+
$password = $skeletor->password('Enter the demo password:', 'password');
22+
23+
if ($password) {
24+
$skeletor->pregReplaceInFile('/^DEFAULT_USER_PASSWORD=(".*?"|[^"\s]*|)$/m', 'DEFAULT_USER_PASSWORD='.$password, '.env');
25+
}
26+
};

0 commit comments

Comments
 (0)