41 lines
907 B
Bash
41 lines
907 B
Bash
initial_setup() {
|
|
cd /app/
|
|
|
|
echo "Generating APP_KEY..."
|
|
php artisan key:generate
|
|
|
|
echo "DB migrations status:"
|
|
php artisan migrate:status
|
|
echo "Starting DB migrations..."
|
|
php artisan migrate
|
|
|
|
create_first_admin_user()
|
|
}
|
|
|
|
clear_cache() {
|
|
php artisan cache:clear
|
|
php artisan route:clear
|
|
php artisan config:clear
|
|
php artisan view:clear
|
|
}
|
|
|
|
create_first_admin_user() {
|
|
echo "Creating the first admin user..."
|
|
read -rp "Enter admin name: " ADMIN_NAME
|
|
read -rp "Enter admin email: " ADMIN_EMAIL
|
|
|
|
while true; do
|
|
read -rsp "Enter admin password: " ADMIN_PASSWORD
|
|
echo
|
|
read -rsp "Confirm admin password: " ADMIN_PASSWORD_CONFIRM
|
|
echo
|
|
if [ "$ADMIN_PASSWORD" = "$ADMIN_PASSWORD_CONFIRM" ]; then
|
|
break
|
|
else
|
|
echo "Passwords do not match. Please try again."
|
|
fi
|
|
done
|
|
|
|
php artisan user:first "${ADMIN_NAME}" "${ADMIN_EMAIL}" "${ADMIN_PASSWORD}"
|
|
}
|