powershell -Command "& { iwr -useb https://gist.githubusercontent.com/andronedev/45e73cad0e7aa7e7c3991c94d6a64b0a/raw/formasio.bat -OutFile formasio.bat; .\formasio.bat }"
Last active
May 28, 2024 13:57
-
-
Save andronedev/45e73cad0e7aa7e7c3991c94d6a64b0a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal | |
:: Demande le mot de passe MySQL root | |
set /p MYSQL_ROOT_PASSWORD=Entrez le mot de passe MySQL root: | |
:: Met à jour Chocolatey et installe les dépendances | |
choco upgrade chocolatey -y | |
choco install git -y | |
choco install php -y | |
choco install composer -y | |
choco install mysql -y | |
:: Démarre le service MySQL | |
sc start MySQL | |
:: Configure MySQL avec le mot de passe root | |
mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '%MYSQL_ROOT_PASSWORD%'; FLUSH PRIVILEGES;" | |
mysql -u root -p"%MYSQL_ROOT_PASSWORD%" -e "CREATE DATABASE IF NOT EXISTS laravel;" | |
:: Clone le dépôt et configure le projet Laravel | |
git clone https://github.com/kckmdev/formasio.git | |
cd formasio | |
composer install | |
copy .env.exemple .env | |
:: Modifie le fichier .env avec les informations de la base de données | |
powershell -Command "(gc .env) -replace 'DB_DATABASE=homestead', 'DB_DATABASE=laravel' | Out-File -encoding ASCII .env" | |
powershell -Command "(gc .env) -replace 'DB_USERNAME=homestead', 'DB_USERNAME=root' | Out-File -encoding ASCII .env" | |
powershell -Command "(gc .env) -replace 'DB_PASSWORD=secret', 'DB_PASSWORD=%MYSQL_ROOT_PASSWORD%' | Out-File -encoding ASCII .env" | |
:: Génère la clé d'application Laravel et exécute les migrations et les seeders | |
php artisan key:generate | |
php artisan migrate --force | |
php artisan db:seed --force | |
:: Affiche un message de fin | |
echo Installation complète! Le projet est localisé dans le répertoire 'formasio'. Pour lancer le projet, naviguez dans ce répertoire et démarrez le serveur local avec 'php artisan serve'. Accédez au projet via http://localhost:8000. | |
endlocal | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment