If you’ve been working with Laravel but are a Windows user, you’ve probably had a few headaches. Homestead, the officially supported Vagrant box doesn’t play nice with Windows, and Valet isn’t even available. I found a nice alternative to both. Laragon.
Now, to be clear, Laragon has nothing to do with Laravel – I don’t think. “Lara” followed by anything just sounds good… seriously let’s try it now:
Laracat, Lararhyno Larapotimus, Laradip, Laracrap, Larastache, Larabat, Laraman, Laradone… See?
OK so Laragon is much like XAMPP or WAMPP if you’ve used those, only a little more convent and relevant for modern development. Here’s how we use it to install Laravel 5.4.
First, install Laragon
Get the download from this page: https://laragon.org/download.html
Click either “Full + Nginx” or “Full + Apache” – whatever your preference. If you don’t have a preference, choose Nginx. It’s the server used on Laravel’s Homestead.
Once download finishes just run the installer, and keep all the default settings.
Laragon should open automatically, and you’ll see a window like this:
Cool beans!
Running the quick create tool
Now you just do this:
- click “Start All”
- right-click anywhere on the window
- click on “quick create”
- select and click on “Laravel”
- type the name of your project
- click “OK”
Couldn’t fit this into one GIF…
Once you follow those steps, a command line interface should pop up. It’ll look like this:
Just twiddle your thumbs for a second, or if you have fixed wireless internet like I do then maybe grab a coffee and stretch your legs 😉
When the install is finished you’ll see some output as such:
Now you can visit the name of your project followed with .dev
in your browser. If you named your project “test” visit “test.dev
“.
And you’ll now have a running Laravel app like so…
To open this project in your editor, navigate to C:\laragon\www\test
And that is it. You’re set up with a pretty URL and a fresh Laravel install hot off the press. Laragon made it a Cinch.
Summary
I’ve been using Laragon for about 3 months now and have been more than happy with it. This post showed off how easy it is to get up and running with Laravel through the GUI, but truthfully I usually just run cd /c/laragon/www && composer create-project --prefer-dist laravel/laravel name-of-project
I’m just faster in the command line and I of course have aliases set up to make that a little easier to type. The nice thing, is that there is nothing to configure to generate your pretty URL. Laragon will automatically write the relation in your etc/hosts
file. You just have to remember to reload the server if you created your project through the command line.
I may cover some other neat tricks with Laragon in a later post, but for now…
Cheers,
Dan
If you liked what you just read, don’t forget to share this article, leave a comment below, and follow me on Facebook or Twitter to get updates.