Laravel - Eloquent - query many to many relationship
Table 1: posts
Table 2: categories
Pivot Table: category_post with foreign keys category_id, post_id
#Laravel 5 Simple ACL manager
Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.
If the user has a 'Root' role, then they can perform any actions.
Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php