Ask a question about related query in laravel
淡淡烟草味
淡淡烟草味 2017-05-16 16:55:10
0
1
368

is a many-to-many association.

// 三个表如下
users   user_role   roles

Now I want to query the name field of all roles

to which all users belong.

How to use Eloquent ORM to write this related query?


solved. .

User::with('roles')->get();
淡淡烟草味
淡淡烟草味

reply all(1)
黄舟

It seems that permission verification needs to be written. It is recommended to use the entrust package. Address: https://github.com/Zizaco/ent...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template