Skip to content

How to Inject Controller constructor with authorization #1299

Answered by hendra1
hendra1 asked this question in Help
Discussion options

You must be logged in to vote

Hi...
I found the solution...
in the middleware
I use the ioc.bind to return the new UserService.

and then in UserController inside the constructor :
this.userService = use('UserService')

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by hendra1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants