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:
macOS: $HOME/.composer/vendor/bin
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.
export PATH="~/.config/composer/vendor/bin:$PATH"
The composer and laravel command will now work globally in different directories and when switching other users.
Any idea how to do this on Windows?
Not familiar with doing this on a Windows box, but the second comment on this link shows how to do so.
https://stackoverflow.com/questions/26451187/how-to-install-laravel-via-laravel-installer-on-windows
Hope that helps!
Laravel is not being kind on beginners on this one. Beginners are usually not familiar with Linux let alone using the terminal. That is why many prefer starting out on a framework like CodeIgniter e.t.c .