is a many-to-many association.
// 三个表如下 users user_role roles
Now I want to query the name field of all roles
name
of all
How to use Eloquent ORM to write this related query?
Eloquent ORM
solved. .
User::with('roles')->get();
It seems that permission verification needs to be written. It is recommended to use the entrust package. Address: https://github.com/Zizaco/ent...
It seems that permission verification needs to be written. It is recommended to use the entrust package. Address: https://github.com/Zizaco/ent...