drupal 8 update with composer code example
Example 1: drupal composer update
composer update drupal/core 'drupal/core-*' --with-all-dependencies
Example 2: drupal 8 composer update
composer update drupal/core "drupal/core-*" --with-all-dependencies