Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Melodia's avatar

My laravel command does not work after I restart my terminal

I just followed the laravel installation process and got everything to work fine, however, after restarting my terminal(oh-my-zsh), if I try to run laravel new projectname, I see this error:

zsh: command not found: laravel

However, if I run composer global show, I see valet and installer are indeed installed:

laravel/installer                        v2.2.1  Laravel application installer.
laravel/valet                            v2.5.2  A more enjoyable local development experience for Mac.

I also tried adding this:

echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.zshrc

and I can see it if I visit my zshrc file

How can I indeed have laravel installer globally and run the laravel commands at any time?

0 likes
4 replies
Melodia's avatar

The source command fixed the issue

Nakov's avatar

@melodia just remember that you will need to do that every single time you open the terminal. Make sure that the file is loaded always when you run a new tab or you open the terminal. That's why I gave the link above so you make sure that the zsh is set to default shell.

Melodia's avatar

Yes, my zsh was set to start as default during the installation, and I am managing to use the laravel commands at any time after restarting the terminal or the machine itself.

Please or to participate in this conversation.