Lifecycle hooks globally affects

System Information
  • Strapi Version: 3.6.3
  • Operating System: MacOs
  • Database: sqlite
  • Node Version: 12.0.0
  • NPM Version: 6.9.0
  • Yarn Version: 1.22.10

Hi all, i’m about to drop my first question in this strapi forum, so pls let me know if i’m doing something in the wrong way.

I was wondering if there is a way to manage a global lifecycle for all content-types. Now the solution i reach is creating a lifecycle before update & create and call a plugin service method in all of them, but i think this is not a good solution.

In order to avoid adding this logic to each of the content-types that will be created in the Strapi instance, i was wondering if there is a way to apply a before-{op} or after-{op} to all content-types / single-type that exists in Strapi.

the same question… because adding to each content-type is not great idea

Have look at database subscription classes. You can gind sample codes in the strap/database sourcecode