zsh: command not found laravel

I'm a newbie when it comes to Linux administration using bash... I was following a tutorial on how to install laravel 5.2 from here... installed it successfully...

firstly I installed composer and ran the following command

composer global require "laravel/installer"

after this put this in my path too in ~/.zshrc like this

export PATH="~/.composer/vendor/bin:$PATH"

When I run the laravel command from the terminal I get the following error

➜  ~ laravel 
zsh: command not found: laravel

If I echo $PATH it shows it have added up in the path

Note: I have installed oh my zsh on my terminal...

What do I have to do to get it working please help


I think ZSH won't expand the ~ on PATH. Try this instead:

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

Try to do this:

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


As a follow up to Chris' answer,

The command export PATH="$HOME/.composer/vendor/bin:$PATH" will work, but only for your current terminal session.

If you would like the path to always be available when zsh launches, add PATH="$HOME/.composer/vendor/bin:$PATH" to the bottom of your ~/.zshrc file. Run the zsh command or restart your terminal and laravel will be available in every session you start.