I would like to know if it's a good way to do things or if it's a no-go to use both (restful and resource) controllers?
Sometimes you want to do the whole "package" (get/store/update etcetc) and sometimes just the easy simple setup like only a get and a post.
Is it a good thing to use both or rather avoid it and stick with 1? (To keep the code overal the same)
Would like to know how others think of this, or if there is even a standard for this :)
I subscribe to the view that restful controllers are not a good idea and should be avoided altogether: routes should be explicit. Resource controllers are okay because they're predictable, if a resource is registered a developer can look at the routes and understand what is happening, that isn't possible with a restful controller: a developer is forced to dig through the various controllers. If your controller isn't for something that can be considered a resource (and only needs a single method for example) then you can register the routes on their own, you don't need to push the routing responsibility onto a controller.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community