B
B
BonBon Slick2017-03-09 23:43:29
Laravel
BonBon Slick, 2017-03-09 23:43:29

How to get another repository?

I use Prettus/L5-repository.
In the controller, let's say UserController, we need to pull data from the RoleRepository repository.
If in the case of the current repository we use this construction:

use App\Repositories\UserRepository; 
...
 public function __construct(VideoRepository $repository, VideoValidator $validator)
    {
        $this->repository = $repository;
        $this->validator  = $validator;
    }
....
$this->repository->all();

How to call from another repository?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question