protected function setByArtistAttribute($items)
    {
        if ( ! is_array($items))
        {
            return $items;
        }

        //Check if not multidimensional array (for backward compatibility)
        if((count($items) == count($items, COUNT_RECURSIVE)))
        {
            return $this->getNestedContext(MusicGroup::class, $items);
        }

        //multiple artists
        return array_map(function ($item) {
            return $this->getNestedContext(MusicGroup::class, $item);
        }, $items);
    }
protected function setByArtistAttribute($items)
    {
        if ( ! is_array($items))
        {
            return $items;
        }

        //Check if not multidimensional array (for backward compatibility)
        if((count($items) == count($items, COUNT_RECURSIVE)))
        {
            return $this->getNestedContext(MusicGroup::class, $items);
        }

        //multiple artists
        return array_map(function ($item) {
            return $this->getNestedContext(MusicGroup::class, $item);
        }, $items);
    }
protected function setByArtistAttribute ( $ items ) { if ( ! is_array ( $ items ) ) { return $ items ; } //Check if not multidimensional array (for backward compatibility) if ( ( count ( $ items ) == count ( $ items , COUNT_RECURSIVE ) ) ) { return $ this -> getNestedContext ( MusicGroup :: class , $ items ) ; } //multiple artists return array_map ( function ( $ item ) { return $ this -> getNestedContext ( MusicGroup :: class , $ item ) ; } , $ items ) ; }
Set artist attribute

@param array|string $items
@return array
Set artist attribute