这是您可以执行的 *** 作:
User::where('id', $id)->with(['groups.permissions' => function ($q) use (&$permissions) { $permissions = $q->get()->unique();}])->first();// then$permissions; // collection of unique permissions of the user with id = $id
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)