How to utilize service providers in Adonis v5? #1421
-
I need a service provider where I want to expose some methods to be used by other controllers. Right now I have stuffed all these logic inside controllers, making the controllers like 500-600 lines each and lots of duplicate codes all around the controllers. Due to lack of documentation, I am at a loss and unable to create providers. Say, I would like to create a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
And why this can't live within a regular Javascript class? And then just import it inside your controller? Yes, there aren't any docs on providers. But you can check the packages source code to get some sense of them until docs are written |
Beta Was this translation helpful? Give feedback.
And why this can't live within a regular Javascript class? And then just import it inside your controller?
Yes, there aren't any docs on providers. But you can check the packages source code to get some sense of them until docs are written