Where to write reusable code to access in all the models

You can create a file called index.js inside the config folder. Inside it you can define functions like this

    module.exports = {
      async something(param) {
        
      },
    };

Then use it somewhere like this: strapi.config.index.something(param);

5 Likes