public function favorite($class)
    {
        return $this->favorites()->where('favoriteable_type', $class)->with('favoriteable')->get()->mapWithKeys(function ($item) {
            return [$item['favoriteable']->id=>$item['favoriteable']];
        });
    }