I have a issue with rendering a menu that uses roles and users. Im using Laravel 5.2 (just for info and maybe a easy solution :) )
What im trying to achieve is to get the current user, with the roles which has actions. The problem is: 2 different roles can contain the
same method and i dont want to get them twice but just one time. How can i achieve this easily?
Can someone help me out please?
My table structure:
This query should give you all the methods (no duplicates) for the user with
select * from methods m inner join methods_roles mr on m.id = mr.method_id inner join user_roles ur on ur.role_id = mr.role_id where ur.user_id = $your_user_id group by m.id