Support the ongoing development of Laravel.io →
Requests IOC Architecture
Last updated 1 year ago.
0

Anyone? bump

0

The controller's entire role in the MVC pattern is to accept input and return responses.

So instead of returning a model directly from controller, you should write a "working" class into which you'll inject whatever you need: the model/any other class useful for you for the required transformation and use that into the controller.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

oniice oniice Joined 17 Jan 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.