--- /dev/null
+/**
+ * Implements hook_module_implements_alter().
+ */
+function {{ machine_name }}_module_implements_alter(&$implementations, $hook) {
+ if ($hook == 'form_alter') {
+ // Move my_module_form_alter() to the end of the list.
+ // \Drupal::moduleHandler()->getImplementations()
+ // iterates through $implementations with a foreach loop which PHP iterates
+ // in the order that the items were added, so to move an item to the end of
+ // the array, we remove it and then add it.
+ $group = $implementations['my_module'];
+ unset($implementations['my_module']);
+ $implementations['my_module'] = $group;
+ }
+}