Solving issues command not found Laravel Valet install on macOS Mojave

PHP Laravel

For some reason and in certain situations, as a business guy with less knowledge in PHP especially Laravel Frameworks, I need to do a small updates or minor fixing in our PHP Laravel Web Application projects.

Of course we have a reliable web developer in our company. But in some cases, they have their own personal life outside working hours. I can't bother their valuable time.

By that with relatively small amount of time that I have, and for the sake of our happiness, hahaha, I do some bug-fix and troubleshooting when we have a problem in our web projects, while our web developers are on vacations.

Short story, on my macOS Mojave version 10.14.6, I'm trying to install PHP Laravel following this documentation, before I clone the web project on our Github to my local development machine.

Instead of installing Laravel directly into my local development machine, after doing some researching what best for me, I've decided to install Laravel with Laravel Valet. Here are my installation workflow:

Valet requires macOS and Homebrew. Before installation, you should make sure that no other programs such as Apache or Nginx are binding to your local machine’s port 80.

  1. Install or update Homebrew to the latest version using brew update
  2. Install PHP 7.3 using Homebrew via brew install php
  3. Install Composer
  4. Install Valet with Composer via composer global require laravel/valet. Make sure the ~/.composer/vendor/bin directory is in your system's "PATH".
  5. Run the valet install command. This will configure and install Valet and DnsMasq, and register Valet's daemon to launch when your system starts.

Everything works fine until run the Valet install, this issues appeared;

zsh: command not found: valet

Well, even for casual web developers who already knows how to setup development environment and production environment, installing and deploying web application is not as easy as it seems. After doing some quick hacking, this solution is works for me. Simply put this command on Terminal.

Oh, by the way, I use Oh My Zsh as my Terminal.

test -d ~/.composer && bash ~/.composer/vendor/bin/valet install || bash ~/.config/composer/vendor/bin/valet install

I attach the full screenshot of my terminal for the exact results.

Valet succesfully installed

To test if Valet is installed correctly, I use this command;


For development purposes, I’ve changed the .test TLD with .dev TLD;

changeing Valet TLD

Once again, using Ping command to test that my changes are working;

ping any dev

Now I can clone a Laravel Apps repository or create new Laravel project (laravel new ecourse) on my local machine.

Not bad for a business guy, right! So what next? Jumpstarts to the source code, learning by doing and start coding.

Email icon representing an email newsletter

Don't subscribe