How to check user roles in canAccessPanel()

Hello, I can't seem to find the code to use to check if a role is assigned to a user from database into canAccessPanel()

I need to check:

role_user pivot table

Admin has role_id 1, user_id 1

Company user has role_id 2, user_id 2
(for this example, but many users will have role_id 2)

I have a different panel for each... AdminPanelProvider for Admin Role, CompanyPanelProvider for Company Role

I tried checking documentation and online and can't figure this out 😦

Thank you in advanced!
Was this page helpful?