Search code examples
linuxbashlaravelpathlinux-mint

Add laravel to path (Linux Mint 18.2 sonya)


I'm trying to use the shortcut "laravel new site" on bash but i got "laravel: command not found".

I already installed laravel by composer, and tried like 5 different ways to add this to PATH.

I added:

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

On the last line of bashrc, rebooted, still not working.


Solution

  • From the laravel installation documentation

    Make sure to place the $HOME/.composer/vendor/bin directory (or the equivalent directory for your OS) in your $PATH so the laravel executable can be located by your system.

    So, instead of

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

    try

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

    When you edit .bashrc file, run command source ~/.bashrc to reload changes