V
V
Vladislav Nagorny2015-11-27 14:44:02
Laravel
Vladislav Nagorny, 2015-11-27 14:44:02

How to get data from controller'[email protected]?

Good day to all.
The question remains: I have a controller (of roles and privileges), I pulled out a list of controllers, how can I get data when accessing from one controller to another? For example RoleController get data from [email protected]?
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vyacheslav Plisko, 2015-11-27
@esvils

This is the code that should be in the service, and not in the controller, but call it like any other like
$data = (new IndexController)->infoRole();

T
Tesla, 2015-12-02
@Tesla

Take the logic out of the controller, for example, into a command bus or repository. I don't know what suits you best.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question