Thanks, but the role can't be in the users table, as a user can have different roles for different teams, events and so on. For example a user can be a reader at Team One but an editor for Team Two.
I'm planning a multi customer website to manage teams. Customer can create users, teams, events and so on. As I'm new in developing with Laravel, I'm wondering if I'm on the right path with my permission concept. I thought, that I will implement different roles like administrator, editor and reader. Data for events, members, teams and so on are stored in different tables. Is it ok, if I store the permission in one separate table 'permission' which will have following fields...
With different policies I would check if the user is authorized to do any actions. For example if the user would like to add new members to a team, I would perform a query to the table permissions. If there would be an entry with the user_id, the role 'editor', the type 'teams' and the id of the team, he would be able to perform the action.
Is this solution ok or is there a more easy or better way?
I'm trying to find a solution to pass data from one view to another. I have to following situation. On the first view I have a table with different data of a user and a button, which opens a new view. On this view I will need the user_id from the first view. How can I transfer the user_id from the first view to a hidden field on the second view? Or is it even better to pass the user_id within a session as flash data?