If you need to add composer to your $PATH all you have to do is add the ‘bin’ directory to the PATH environment through the ~/.bashrc configuration. To do this, you need to edit the ~/.bashrc file with this command using nano or any other text editor, for example:
And add the following code line at the end of the file.
Save and reload your .bashrc configuration using the cource command.
Echo $PATH to confirm. It will output your “Bin” directory path for the Composer package.
Now you have added the 'bin' directory to the compoer package in your $PATH environment.
This is very helpful if you are using laravel for example.