cviebrock / eloquent-taggable

Easily add the ability to tag your Eloquent models in Laravel.
MIT License
537 stars 72 forks source link

Paginate Popular Tags #67

Closed keithgulbro closed 6 years ago

keithgulbro commented 6 years ago

Hi there,

Thanks for creating a great package! I ran into a situation in which I'd like to paginate the popularTags returned by a given model however when I attempt to execute something like the following:

Model::popularTags->paginate(10);

since the data returned is in array instead of a collection form the standard ->paginate() method doesn't work.

Could you please advise?

cviebrock commented 6 years ago

collect(Model::popularTags)->paginate(10); maybe?

keithgulbro commented 6 years ago

Thank for responding, your answer was helpful!