How to enable / disable a module in settings.local.php
I don't know if it is possible to enable / disable modules in settings.local.php but for downloading and enabling modules you can use drush, like so:

drush dl views
drush en views -y


For disabling the modules use:

drush dis views -y


Another method is to implement hook_update() in a custom module's module file to disable / enable modules.

/**
* Uninstall views module.
*/
function MODULENAME_update_7000(&amp;$sandbox) {
   module_disable(array('views'));
   drupal_uninstall_modules(array('views'), FALSE);
}


Of cource you can also use module_enable in the hook_update()

/**
* Install views module.
*/
function MODULENAME_update_7001(&amp;$sandbox) {
   module_enable(array('views'));
}


If you use hook_update then remember to do:

drush updb 


and 

drush cr


Hope this can help you.