bro create a roles table and role_user and users roles table include your roles SuperAdmin, Admin , Manager .. like this
Check if user is admin
We have two separate types of admins. One "superadmin" that can do a lot. Then we have a "lower" admin that can do other things. In the code we have for the logged in user as "superadmin" this:
@if(\Auth::user()->is_admin) and the column in the users is_admin is 1. This works of course.
But for the "lower" admin there is a value in another table, not in the users table. It is in "clubs_admins" and when the user is that admin there is value "admin" in the column "role". How should I formulate the @if - statement for for that? Tried several ways but no success.
The table contains of: id, users_id, clubs_id, role,created_at,updated_at and deleted_at.
Please or to participate in this conversation.