That's the logic to render all roles, and inside each one, render all permissions.
@foreach($roles as $role)
{
@foreach($permissions as $permission)
{
// do stuffs
}
}
But i think you are missing some theories from relationship with eloquent. You are not using any third party package for roles&permissions, are you? If not, you should consider to use one.