It sounds like it's not 100% related to dependency injection. I feel like you're looking for a chain of responsibility pattern.
Try http://dsheiko.com/subpage/chain-of-responsibility-pattern
That was quick and is what I'm looking for! :) I'll just need to amend it so that it stops running through the chain after the first success, but that's easy to do.
The dependency injection is just to make our unit testing easier (I'm still fairly new to thinking in a unit testable way)... I've realised being able to inject my own class gives me the ability to do things like:
That's great though... that's put me on the right track.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community