How to use composer for module dependency? I installed Drupal 8, and for the Panels module, I had to install the following other modules manually:


Page Manager
Layout
Chaos tools suite


Can we use composer to install modules with their dependencies?
See this composer template for Drupal project for an example of how this works. Usage:

composer create-project drupal-composer/drupal-project:8.x-dev some-dir --stability dev --no-interaction


With composer require ... you can download new dependencies to your installation.

cd some-dir
composer require drupal/devel:~1.0