Where structurally include the control of access rights in Laravel?

Hello. There is a model category, and notes in Laravel. To standard authorization bolted roles (each role has a numerical value of your weight, for example, the user 100, editor 1000, the administrator 9999). Where architectural to include a tolerance check when receiving the next request. Tolerance can be either explicit (the request allowed/not allowed in principle, for example, the user can not create a category in contrast to the admin), and limited (for example, the editor cannot explicitly remove a category if it contains an article or subcategory, and admin can). How best to implement it?
I thought I'd split the test into 2 parts. The first through middlware (as in documentation) check the weight of the user role for a specific operation (ie, Auth::user()->role->weight >= 1000 is the tolerance editor and above), and specific checks such as restrictions removal done directly in the controller.
Thanks in advance for the help
June 3rd 19 at 19:22
1 answer

Find more questions by tags Laravel