.module file not being discovered I am developing a custom Drupal 8 module on my local VM. When I first created and enabled my module, it did not have a .module file (just a controller). Now I have added a .module file so I can add an implementation of hook_entity_insert() but Drupal is not discovering it. I have tried going to Configuration > Performance > 'Clear all caches' but no joy!  

How can I get Drupal 8 to discover the .module file in my custom module?
Just clearing cache is not enough, you need to uninstall and then re-install your module in order for the .module file to be discovered. 

In the Admin panel go to Extend and select the Uninstall tab. Select your custom module and click the Uninstall button. Now go back to the List tab and re-enable your module as before. Your implementation of hook_entity_insert() should now be recognised.