Your right in saying that controllers shouldn't really talk to each other. It depends on your project, but it makes them tightly coupled. IE, one relies on the other a little too much.
I would approach this by firing an event. Other services can then list for that event and react as you want it to. This way, other services could fire the same event and and get responded to.
Take a look at http://laravel.com/docs/5.1/events
Hope that helps.
I guess that since you're building a shop, you don't have all of your business logic directly in the controller but references another class containing the actual logic. As T2theC said, you could fire an event or listen for a model event, and then perform you notification.
Maybe you can get rid of some of the code in the MessagerController and make it even more clean??
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community