src/Helpers.php
public static function mapAuthorityByClass(array $authorities)
    {
        $map = [];

        foreach ($authorities as $authority) {
            if ($authority instanceof Model) {
                $map[get_class($authority)][] = $authority->getKey();
            } else {
                $map[Models::classname(User::class)][] = $authority;
            }
        }

        return $map;
    }
public static function mapAuthorityByClass(array $authorities)
    {
        $map = [];

        foreach ($authorities as $authority) {
            if ($authority instanceof Model) {
                $map[get_class($authority)][] = $authority->getKey();
            } else {
                $map[Models::classname(User::class)][] = $authority;
            }
        }

        return $map;
    }
public static function mapAuthorityByClass ( array $ authorities ) { $ map = [ ] ; foreach ( $ authorities as $ authority ) { if ( $ authority instanceof Model ) { $ map [ get_class ( $ authority ) ] [ ] = $ authority -> getKey ( ) ; } else { $ map [ Models :: classname ( User :: class ) ] [ ] = $ authority ; } } return $ map ; }
Map a list of authorities by their class name.

@param  array  $authorities
@return array
Map a list of authorities by their class name .