laravel-homestead-windows-installer
v0.4.6
Published
Helps installing a new Laravel project on a Windows machine running Homestead as a VM
Downloads
15
Maintainers
Readme
Laravel Homestead Windows Installer
Check out my sister project Larawin. It makes everything easier!
CLI to create a Laravel new site installation in your Windows + Homestead Virtual Machine environment.
It SSH into your Homestead server, then downloads and installs Laravel into your projectName folder. Afterwards, the script provisions your virtual machine and also adds the projectName and IP to Windows hosts file.
It can also only create databases on the VM, without provisioning a new server installation
TOC
- Requirements
- Installation
- Configuration
- Usage
- Command Line Arguments
- IMPORTANT - READ THIS!
- Todo
- Contributing
- License
Requirements
Installation
npm install -g laravel-homestead-windows-installer
Configuration
The following is the default configuration:
- vagrantFileDir: ~/.homestead/
- homesteadFile: ~/Homestead/Homestead.yaml
- installDir: ''
- sharedFolder: ~/Code
- ip: "192.168.10.10"
- noProject: false
You can find the default configuration file at:
cd ~/
ls .laravel-homestead-windows-installer.json
You may override the values you need.
Example:
{
"installDir": "Projects",
"vagrantFilePath": "D:/Homestead",
"sharedFolder": "D:/Code"
}
In this example, all new projects will be created under D:/Code/Projects and the Vagrantfile to start and provision the server is in D:/Homestead
Usage
Open Git Bash and type:
laravel-homestead-windows-installer --name projectName
laravel-homestead-windows-installer -n projectName
Command Line Arguments
--name projectName or -n projectName
- required
- Try to provide a qualified name, such as project.app or project.local
--vagrantfile path/To/Vagrantfile/ or -f path/To/Vagrantfile/
- optional
- Path to where you cloned laravel/homestead
- defaults to ~/Homestead
--database databaseName or -d databaseName
- optional
- inform a name to create a new database
--ip X.X.X.X or -i X.X.X.X
- optional
- Virtual Machine IP Address
- Defaults to 192.168.10.10 (check your Homestead.yaml file to verify)
--install-dir
- optional
- The dir or subdir you want to create your project. This dir is created under the default shared folder path.
--no-project
- optional
- This flag disables project creation
- NOTE: the flag --name or -n overrides --no-project
--version or -V
- Show current version
--help
- Display help text
After install, you can open your browser to http://mysuperproject.app
IMPORTANT!
This script opens and writes the windows hosts file, which is a protected file. You MUST run Node JS (npm) and Git Bash for Windows in administrator mode.
Todo
- Add other properties to Homestead.yaml such as ports and blackfire
- If database is informed, automatically add to .env file after project creation
Contributing
- Fork this project
- Create a new branch
git checkout -b branch-name
- Make your modifications
- Test it -- run
npm i -g
from the root folder and test it - Send the pull request
- If possible, please provide thorough information on what as done
- If I merge your pull request, your name and email will be added as a contributor
License
MIT
Copyright (c) 2017 Bruno Vaula Werneck
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.