In this tutorial, we’ll learn how to install and use Composer.
Composer is a PHP dependency manager that simplifies adding and managing libraries in your PHP projects.
A dependency can be simply added like so: composer require phpmailer/phpmailer
If you now take a look in your project directory you will see that some files were added. To use your dependencies you must first require() the Composer autoload.php file located inside the vendor folder. Then you can use the use keyword to specify what dependencies you will be needing.