We will try and help you get setup on Windows 7 or Windows 10 to start contributing to the web-api repository!
- Windows 7 or Windows 10
- Internet Connection
- Patience
Git Bash is a great way to simulate a bash environment while on windows making web development easier.
Git Bash is included in the Git For Windows Installer.
- Download and install the latest version
At this point, You may want to open up Git Bash terminal as we will be using it throughout this documentation.
This will help setup a common PHP installation on windows.
This setup is not specific to our project and should be good for most projects.
-
Download the latest PHP7 (non-thread safe version) zip file from HERE
-
Extract the contents of the zip file into
C:\PHP7 -
Copy
C:\PHP7\php.ini-developmenttoC:\PHP7\php.ini -
Open the newly copied
C:\PHP7\php.iniin a text editor like Notepad++. -
Scroll down to
“Directory in which the loadable extensions (modules) reside.”and uncomment:extension_dir = “ext”
Should look like:
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
extension_dir = "ext"- Scroll down to the
Dynamic Extensionssection and uncomment the following extensions:
extension=bz2
extension=curl
extension=fileinfo
extension=gd2
extension=gettext
extension=gmp
extension=intl
extension=imap
extension=ldap
extension=mbstring
extension=exif
extension=mysqli
extension=odbc
extension=openssl
extension=pdo_mysql
extension=pdo_odbc
extension=pdo_pgsql
extension=pdo_sqlite
extension=pgsql
extension=shmop
extension=soap
extension=sockets
extension=sqlite3
extension=tidy
extension=xmlrpc
extension=xsl- Add
C:\PHP7to the Windows system path environment variable.
Windows 7
Important: on windows 7 you must add to the paths value ... the values are separated with a ;
Windows 10
- Finally, In Git Bash test that the installation is successful by typing
php -v
Should see something similar to:
PHP <version> (cli) (built: <date time>)
...
This is the easiest way to get Composer set up on your machine.
Download and run Composer-Setup.exe. It will install the latest Composer version and set up your PATH so that you can call composer from any directory in your command line.
Download and install the latest version from VirtualBox Downloads
Download and install the latest version from Vagrant Downloads
On windows this can be a bit tricky.
We are using the domain api.indiehd.site, note the .site ...
Windows 10
- Press the Windows key
- Type
notepadin the search field - In the search results,
right-click Notepadandselect Run as administrator - From Notepad,
openthe following file:C:\Windows\System32\Drivers\etc\hosts - Add
192.168.10.10 api.indiehd.siteto the file - Click
File -> Saveto save your changes
Windows 7
- Click
Start -> All Programs -> Accessories Right-click Notepadandselect Run as administratorClick Continueon the needs your permission window- When Notepad opens,
click File -> Open - In the
File name field, typeC:\Windows\System32\Drivers\etc\hosts, Click Open - Add
192.168.10.10 api.indiehd.siteto the file - Click
File -> Saveto save your changes
Open up Git Bash. It will be used to run all commands used in this section
This will help keep your web projects organized.
- Run these two commands:
mkdir ~/projects
mkdir ~/projects/www
Open up Git Bash. It will be used to run all commands used in this section
- Run
cd ~/projects/www && https://github.com/indiehd/web-api.git
Open up Git Bash. It will be used to run all commands used in this section
- Run
cd ~/projects/www/web-api - Run
composer install - Run
mv .env.example .env - Run
php artisan key:generate
Open up Git Bash. It will be used to run all commands used in this section
Add the vagrant box
- Run
vagrant box add laravel/homestead
Installing
Please be sure to check the official Laravel documentation for the most updated instructions
- Run
git clone https://github.com/laravel/homestead.git ~/Homestead - Run
cd ~/Homestead && git checkout v7.17.0 - Run
bash init.sh(If this fails try executing theinit.batin that directory)
Configuring
- Open the
Homestead.yamlfile in the~/Homesteaddirectory
Please note we are working with Yaml, which is very picky regarding tabs vs spaces.
Opening this file in Notepad++ and selecting Yaml under the Language menu will help
highlight issues.
-
The first thing we need to configure here is the
folderssectionfolders: - map: "C:\Users\<YOUR USERNAME>\projects" to: /home/vagrant/projects
Now all your projects can be accessed from with in the vagrant vm
-
Next we will setup our site to be served by homestead We are using the domain
api.indiehd.sitethat we setup in the Hosts Filesites: - map: api.indiehd.site to: /home/vagrant/projects/www/web-api/public
Make note of the
/publicdirectory -
Next we need to setup a couple databases
databases: - homestead - indiehd - indiehd_test
Thats It! Save this file and exit ..
Open up Git Bash. It will be used to run all commands used in this section
Before we check to make sure that everything it working correctly we need to run a few commands to get the project setup.
-
Run
vagrant upBe sure there are no errors here. They will be highlighted in red. You may also see a bunch of warnings like below that can be ignored assuming it eventually finishes
homestead-7: Warning: Connection reset. Retrying... homestead-7: Warning: Remote connection disconnect. Retrying... -
Confirm the site is accessible via
http://api.indie.siteYou should see a page of some sort that will indicate that its working
-
Run
vagrant sshThis will log you into the vm via ssh as
vagrantuser. You should end up at a prompt like below.vagrant@homestead:~$
You are now working inside the Virtual Machine (Ubuntu)
- Run
cd projects/www/web-api - Run
php artisan migrate --seed
This will seed a bunch of dummy data into the database, this is useful during development
That's It!!
Having issues please join our discord server and Join #support and ask for help.

