I need to mount an array in PHP (LARAVEL) and I can not find a way to do it.
I have a user system with roles and permissions. When I view the user, I clear all the permissions, but one below the other. Ex:
> users-index
> users-show
> users-create
> roles-create
> roles-delete
But I would like to do the following:
Get all these permissions and separate them by category to list in separate tables, where this is the category is the word before the "-" (USERS-index), ex array:
ArrayAll = [ users = [ users-index, users-show, users-create ] roles = [ roles-create, roles-delete ] ]
I count on ideas! Hugs