Challenge: you need a flexible (swap in other repository implementations) way to display some kind of resource. Let's say, Posts. What does your folder structure look like?
Requirements:
- Repository implements an interface
- Must show at least one implementation of the interface (Eloquent version is fine)
- The interface is injected into your PostsController.
- Show where you register your IoC bindings
- Show folder structure. Where are interfaces/repositories stored?
@JeffreyWay Yes, I typically duplicate the find() method, since they will more often than not have somewhat different requirements (i.e. eager loading a join). I've played with having a common repo that gets extended, but found it not worth the effort....yet.