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?
hey all just wondering if you might be able to help me out, i've just read through each example and its got me thinking that im now doing things wrong as i dont write my code in this way at all and that I should really start to, for the reasons mentioned above.
My main question is that within the post interface will I have to name all the methods that are default with Eloquent such as find or all() or even the type of whereField() methods? or can i just use them as you did with
$this->post::whereOrderNo($order_no)
sorry if I sound really stupid here, its just i've never really written code like the above and since starting using L4 its really made me think about how im doing things and how I can write better code which im very enjoyable!
thanks
Dan