How to properly implement user groups?

Hi all.

Started a user group on the website:
1. Made the add/edit groups and permissions (stored in JSON format)
2. Modify group the user.
3. When logging in the session is added to the current group and its capabilities.
Now you need not to make a mistake.

How to implement the following:
1. You need to decode the JSON string in session, but unserialize is not suitable.
2. How to make all ranting and passed through right?

I guess you need to create your middleware, then register in Kernel.php but then how to participate in the session?

In General, I will be glad to all councils.
You want to properly implement user access rights.

Thanks in advance!8435acdd67914e958fb351836c55a666.jpg
August 19th 19 at 23:11
2 answers
August 19th 19 at 23:13
August 19th 19 at 23:15
Just use https://github.com/JosephSilber/bouncer
Connects for a few seconds, has limitless possibilities.. write your bike is, at least, silly.
well, you can remove))))) - lester55 commented on August 19th 19 at 23:18

Find more questions by tags LaravelPHP