Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- echo Created by VeeRa (*_#)
- echo.
- mkdir resources\views\auth
- mkdir resources\views\backend
- mkdir resources\views\emails\backend
- mkdir resources\views\emails\frontend
- mkdir resources\views\pdf
- mkdir resources\views\layouts
- mkdir resources\views\partials\backend
- mkdir public\uploads
- mkdir public\css
- mkdir public\js
- mkdir public\plugins
- mkdir public\images
- mkdir app\Import
- mkdir app\Export
- mkdir app\Mail
- mkdir app\Http\Requests
- mkdir app\Http\Controllers\API
- mkdir app\Http\Controllers\Auth
- mkdir app\Http\Controllers\Backend
- mkdir app\Http\Middleware
- REM Define the path for helpers
- set "filePath=app\Helpers.php"
- REM Check if the helpers file already exists
- if not exist "%filePath%" (
- echo ^<?php > "%filePath%"
- echo // Helper functions can be added here >> "%filePath%"
- echo File created: %filePath%
- ) else (
- echo File already exists: %filePath%
- )
- REM Define the path for Kernel.php
- set "kernelPath=app\Http\Kernel.php"
- REM Check if the Kernel.php file already exists
- if not exist "%kernelPath%" (
- echo ^<?php > "%kernelPath%"
- echo namespace App\Http; >> "%kernelPath%"
- echo. >> "%kernelPath%"
- echo use Illuminate\Foundation\Http\Kernel as HttpKernel; >> "%kernelPath%"
- echo. >> "%kernelPath%"
- echo class Kernel extends HttpKernel >> "%kernelPath%"
- echo { >> "%kernelPath%"
- echo // Add Code Here >> "%kernelPath%"
- echo } >> "%kernelPath%"
- echo Kernel.php file created: %kernelPath%
- ) else (
- echo Kernel.php file already exists: %kernelPath%
- )
- REM Check if .env.example file exists before copying
- if exist ".env.example" (
- REM Check if .env file already exists
- if exist ".env" (
- set /p overwriteEnv="The .env file already exists. Do you want to overwrite it? (yes/no): "
- if /i "%overwriteEnv%"=="yes" (
- copy .env.example .env
- echo .env file has been overwritten with .env.example.
- REM Uncomment DB related lines in .env using PowerShell
- powershell -Command "(Get-Content .env) -replace '^# DB_HOST=', 'DB_HOST=' | Set-Content .env"
- powershell -Command "(Get-Content .env) -replace '^# DB_PORT=', 'DB_PORT=' | Set-Content .env"
- powershell -Command "(Get-Content .env) -replace '^# DB_DATABASE=', 'DB_DATABASE=' | Set-Content .env"
- powershell -Command "(Get-Content .env) -replace '^# DB_USERNAME=', 'DB_USERNAME=' | Set-Content .env"
- powershell -Command "(Get-Content .env) -replace '^# DB_PASSWORD=', 'DB_PASSWORD=' | Set-Content .env"
- REM Update DB_CONNECTION in .env file using PowerShell
- powershell -Command "(Get-Content .env) -replace '^DB_CONNECTION=.*', 'DB_CONNECTION=mysql' | Set-Content .env"
- REM Prompt user for DB_DATABASE name
- set /p dbname="Enter the DB_DATABASE name: "
- REM Update DB_DATABASE in .env file using PowerShell
- powershell -Command "(Get-Content .env) -replace '^DB_DATABASE=.*', 'DB_DATABASE=%dbname%' | Set-Content .env"
- echo DB_DATABASE has been updated to %dbname%
- ) else (
- echo .env file will not be overwritten.
- )
- ) else (
- copy .env.example .env
- echo .env.example file copied to .env
- REM Uncomment DB related lines in .env using PowerShell
- powershell -Command "(Get-Content .env) -replace '^# DB_HOST=', 'DB_HOST=' | Set-Content .env"
- powershell -Command "(Get-Content .env) -replace '^# DB_PORT=', 'DB_PORT=' | Set-Content .env"
- powershell -Command "(Get-Content .env) -replace '^# DB_DATABASE=', 'DB_DATABASE=' | Set-Content .env"
- powershell -Command "(Get-Content .env) -replace '^# DB_USERNAME=', 'DB_USERNAME=' | Set-Content .env"
- powershell -Command "(Get-Content .env) -replace '^# DB_PASSWORD=', 'DB_PASSWORD=' | Set-Content .env"
- REM Update DB_CONNECTION in .env file using PowerShell
- powershell -Command "(Get-Content .env) -replace '^DB_CONNECTION=.*', 'DB_CONNECTION=mysql' | Set-Content .env"
- REM Prompt user for DB_DATABASE name
- set /p dbname="Enter the DB_DATABASE name: "
- REM Update DB_DATABASE in .env file using PowerShell
- powershell -Command "(Get-Content .env) -replace '^DB_DATABASE=.*', 'DB_DATABASE=%dbname%' | Set-Content .env"
- echo DB_DATABASE has been updated to %dbname%
- )
- ) else (
- echo .env.example file does not exist.
- )
- REM Create multiple files in the Auth controller directory
- set "authDir=app\Http\Controllers\Auth"
- set "controllerFiles=ConfirmPasswordController.php ForgotPasswordController.php LoginController.php RegisterController.php ResetPasswordController.php VerificationController.php"
- for %%f in (%controllerFiles%) do (
- if not exist "%authDir%\%%f" (
- echo ^<?php > "%authDir%\%%f"
- echo // %%f file created >> "%authDir%\%%f"
- echo File created: %authDir%\%%f
- ) else (
- echo File already exists: %authDir%\%%f
- )
- )
- REM Create Blade view files in the auth directory
- set "viewDir=resources\views\auth"
- set "bladeFiles=confirm.blade.php email.blade.php reset.blade.php login.blade.php register.blade.php verify.blade.php"
- for %%b in (%bladeFiles%) do (
- if not exist "%viewDir%\%%b" (
- type nul > "%viewDir%\%%b"
- echo File created: %viewDir%\%%b
- ) else (
- echo File already exists: %viewDir%\%%b
- )
- )
- if exist "composer.json" (
- composer install
- php artisan key:generate
- php artisan migrate
- php artisan optimize:clear
- php artisan cache:clear
- php artisan config:cache
- php artisan config:clear
- php artisan view:cache
- php artisan view:clear
- php artisan route:clear
- php artisan install:api
- php artisan route:list
- ) else (
- echo composer.json file does not exist.
- )
- echo Folders and Files Created Successfully.
- pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement