Kyslik / column-sortable

Package for handling column sorting in Laravel 5/6/7/8
MIT License
644 stars 105 forks source link

Is not working on Polymorphic relationship #158

Closed weeliem closed 3 years ago

weeliem commented 4 years ago

Hi, thanks for this awesome package. I found out that this package is not working on Polymorphic Relationship.

For example, there is a total of three tables.

posts videos comments

Now, the reason we can apply the Polymorphic Relationship here is that comment can be applied to both posts and videos.

So, the Comment model can be associated with Post and Video. When i view the comment section, the comment table will have name column represent either the name of post and video. But this name column have to be sortable by this package and it's not working.

May i know if this package is actually supported Polymorphic Relationship?

Kyslik commented 3 years ago

Polymorphic relationships are not supported - https://github.com/Kyslik/column-sortable#hasone--belongsto-relation-sorting