You don't want to duplicate code. That makes sense, you'd have to change multiple places if the code needed to change.
The way to solve for this is not to have controllers interact with one another. It's to create an object that is responsible for something that you need, and injecting it into each controller that you need. In this way you can use the functionality all over the place.
create an object that is responsible for something that you need
Like a global variable?
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us
The Laravel portal for problem solving, knowledge sharing and community building.