src/Traits/HasRolesTrait.php
public function eachRole(array $roles, callable $callback)
    {
        $roles = array_flatten($roles);

        foreach ($roles as $role) {
            if ($role = $this->prepareRole($role)) {
                $callback($role);    
            }
        }
    }
public function eachRole(array $roles, callable $callback)
    {
        $roles = array_flatten($roles);

        foreach ($roles as $role) {
            if ($role = $this->prepareRole($role)) {
                $callback($role);    
            }
        }
    }
public function eachRole ( array $ roles , callable $ callback ) { $ roles = array_flatten ( $ roles ) ; foreach ( $ roles as $ role ) { if ( $ role = $ this -> prepareRole ( $ role ) ) { $ callback ( $ role ) ; } } }
Calc each rote

@param array $roles
@param callable $callback
Calc each rote