How to fix Laravel command not found for zsh on MacOS

- Andrés Cruz

En español

How to fix Laravel command not found for zsh on MacOS

The terminal commands are great in the Laravel ecosystem since they allow you to create the project to be able to manage different parts of it; when we install the Laravel installer globally with composer, many times it is not recognized as a valid command until we add it to the path; let's see how to do it.

To allow the use of commands beginning with 'laravel', you will need to edit your .zshrc file; usually this happens when executing the laravel installer:

laravel new proyectolaravel

This file should be in your home folder.

First, check if the file exists:

open -e ~/.zshrc

Next, add the following code to the bottom of your .zshrc file:

PATH="$HOME/.composer/vendor/bin:$PATH"

Save the file. The changes will now be implemented in any new terminal session. Please stop the current session or run the code below, and then it will work for the current session as well:

source ~/.zshrc
Andrés Cruz

Develop with Laravel, Django, Flask, CodeIgniter, HTML5, CSS3, MySQL, JavaScript, Vue, Android, iOS, Flutter

Andrés Cruz In Udemy

I agree to receive announcements of interest about this Blog.

!Courses from!

10$

On Udemy

There are 3d 14:12!


Udemy

!Courses from!

4$

In Academy

View courses

!Books from!

1$

See the books
¡Become an affiliate on Gumroad!