In the Laravel installation documentation it says:
Make sure to place composer’s system-wide vendor bin directory in your $PATH so the laravel executable can be located by your system. This directory exists in different locations based on your operating system; however, some common locations include:
GNU / Linux Distributions: $HOME/.config/composer/vendor/bin
But it really doesn’t mention how to do this and assumes you’re already a system administrator on Linux 🙂
When logged in a root via SSH you can run the following command to set the path above. Keep in mind we’re running on CentOS 7 64-bit so if you are on another flavor of Linux you’re $PATH could be different.
The composer and laravel command will now work globally in different directories and when switching other users.