Skip to content

Conversation

@winglian
Copy link
Contributor

Currently only self-handling commands can have their dependencies resolved out of the IoC. This will properly name any parameters that get passed from the job data so that the Event being handled can also be properly injected into the handler.

@winglian winglian changed the title Allow dependencies to be resolved out of the IoC for Queued Event Handlers [5.0] Allow dependencies to be resolved out of the IoC for Queued Event Handlers Feb 15, 2015
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use braces, or one line...

@taylorotwell
Copy link
Member

Huh? Just type hint your dependencies on the event handler's constructor.

@winglian
Copy link
Contributor Author

@taylorotwell Perhaps we should change the documentation "You may type-hint any dependencies you need on the handle method and the IoC container will automatically inject them" then on http://laravel.com/docs/5.0/queues ?

@taylorotwell
Copy link
Member

Ok I'm confused. You're PR talks about events, not commands. On event
handlers you would inject through constructor.

On Sunday, February 15, 2015, winglian notifications@github.com wrote:

@taylorotwell https://github.com/taylorotwell Perhaps we should change
the documentation "You may type-hint any dependencies you need on the
handle method and the IoC container will automatically inject them" then
on http://laravel.com/docs/5.0/queues ?


Reply to this email directly or view it on GitHub
#7443 (comment).

@winglian
Copy link
Contributor Author

Thanks. I think it was my confusion about Queued Events and trying to use the Queues documentation for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants