Laravel & Ecosystem (50 Qs)•Part 3: Octane, High-Throughput Scaling & Enterprise Design (25 - 35)
What is the difference between Single-Action Controllers (`__invoke`) and Resource Controllers?
senior LevellaravelOctane
In Simple Words:
- Resource Controller: Contains standard RESTful CRUD actions (
index,create,store,show,edit,update,destroy). - Single-Action Controller (
__invoke()): Dedicated controller class responsible for strictly one complex operation (e.g.GenerateMonthlyInvoiceController). Promotes the Single Responsibility Principle.