Version: Dirty-n-Rough (v 0.1.0) Author: Chris Holbrook
A Simple Windows version of Laravel Valet
A Windows batch file that setup a new Laravel Project, Setup your host file, and open your text editor and browser.
Requirements
- PHP
- SQLite (Optional: MySQL or MariaDB)
- Windows
- Composer
- Laravel Installer
- Administrative Rights
This script assumes the following factors:
- You store your projects at: C:\projects\
- You use Sublime Text 3, and is installed in the default location
- You use Firefox, and is installed in the default location
- Windows is installed on a partition of C:
- PHP is locally installed
- Composer is Installed
- Laravel Installer is installed
- You can obtain Administrative Rights on the machine
Theretically you should be able to drop the laramake.bat in to a folder that is already in your $PATH (e.g. C:\Windows) and should be able to open a new command prompt have access to it. If you rename the file to laramake (without the .bat) you should be able to call it from the prompt like so:
$ laramake
NOTE: Also, you could rename the file to anything you want, e.g. laraboom, laramagic, etc
- Open your Terminal - Command Prompt
- Type
laramake
at the command line - If you have User Access Control activated, you will be prompted for Administrative Access - Yes
- Then you will be asked for a project name. This will the URL and Folder Name for your project, you should only use alphanumeric, hyphens, and dots in this name (URL complaint symbols). For an example:
demo
- Then Laravel will be installed.
- Then Your Git Repo is initialized.
- Then Sublime opens with your project files
- Then you will be asked if you would to add entries to your host files. This is what make the .dev domain work on your computer. Two entries will be created along with a note, use the project name
demo
the entries create looks like:
# Project demo at c:\projects\demo
127.0.0.1 demo.dev
127.0.0.1 www.demo.dev
- Then the built-in Laravel/PHP web server is started - in its own windows - at project-name.dev on port 80
- Then Firefox is launched and pointed to project-name.dev
- Then two extra command prompt windows are open for your needs, e.g. Git, Task Runner, Generators, etc.
- And finally a summary: where your files are located and the projects URL
- Must be CAREFUL on Path for Project. I have already put a project in my System32 folder.
- Hard Coded for the following things:
- Project Path
- Host File
- Text Editor/IDE Path
- Hard Coded to Firefox
- Could use xip.io Domains
- Assume use of a SQLite Database instead of MySQL/MariaDB (you could always install MySQL and use it anyway).
- No Error Handling :\
- Windows Only - The whole point.
- No Tests