M
M
mrSeller2018-02-11 11:05:22
Laravel
mrSeller, 2018-02-11 11:05:22

How to get users with specific role using Zizaco/Entrust?

According to the documentation, I write in the controller: I get an error:
$admins = User::withRole('admin')->get();

Call to undefined method Illuminate\Database\Query\Builder::withRole()

How so? Maybe you need to connect something somewhere?
Before that, there were no problems at all - all the methods described in the docks worked.
UPD: I found where the problem seems to be solved , but what needs to be done for this, based on the answer, is not clear to me.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mrSeller, 2018-02-11
@mrSeller

I changed require in composer.json "zizaco/entrust": "5.2.x-dev"to "zizaco/entrust": "dev-master", registered it in the console composer updateand everything worked

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question