Since role and a user is a many to many relationship so to speak, I think you need to add another model and table for roles.
So that a user can have many roles and permissions associated with it.
Take a look at this package
Good practice on adding simple user roles
I'm new to Laravel and I hope I can get some advices from someone with experience.
I have a user table with an additional string attribute named "role". It will only contain 3 different roles, one player, one coach and one admin.
Right now, I have edited the register form so that it accepts those 3 roles and it works fine to add the users with different role attributes.
I have created a middleware for the role handling but need some coding assistance on how to verify that the user has a specific role. The goal in this case is to make a simple route verify that the user has a specific role.
What would be a good practice to make it happen using Laravel 5.1? Also I'm wondering, would it be better if I create a separate table for the roles and add a foreign key to the user? Even if it's a simple case? Appreciate all the help I can get.
Please or to participate in this conversation.