First Published 22/07/2020

Contents

I've recently started to learn Laravel and pretty early on the course introduced me to local development, by local I mean directly off the machine, rather than using a tool or VM (Homestead) as I had been doing.

The tool introduced was Valet, it's described in their documentation as 'a Laravel development environment for Mac minimalists.' Naturally, my next thought was 'if I can run a Laravel application locally, why do I need MAMP or Homestead to run WordPress sites?' - and thus I set out to see if this was possible.

Yes, it is.

<aside> 💡

Please note: A lot of what I'm about to run through I followed from this guide. I'm going to include some fixes for issues I ran into but I am in no way taking any credit for their work.

</aside>

Installing Homebrew and the required packages

Homebrew is a package manager for MacOS, through this we can install PHP, MySQL and a whole load of other packages -you can search them all here.

Before we get to MySQL and PHP we need to actually install Homebrew. This is pretty straightforward - all we need to do is open up the Terminal and run this command:

/bin/bash -c "$(curl -fsSL <https://raw.githubusercontent.com/Homebrew/install/master/install.sh>)"

We now have Homebrew installed and can start to use this to install all the other packages we're going to need:

We also need to install the package that links WP CLI and Valet together: