Kyslik / column-sortable

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

[FR/Proposal] Per-Model Default Sort #133

Open AAllport opened 5 years ago

AAllport commented 5 years ago

Proposal to add $sortableDefault to the model that will be used when sortable() $defaultParameters is passed null. This would override columnsortable.default_first_column

$sortableDefault would follow the same format as $defaultParameters

Happy to write the code myself!

Kyslik commented 5 years ago

Hey @AAllport if it makes sense to you sure go ahead; please make sure you add proper tests and readme.

AAllport commented 5 years ago

Yeah, there are a few times that I've overridden the sortable function, that in tern called the vendor provided one with some default's. Makes sense where you want to explicitly define the defaults for things displayed in the user, but no in tasks, If that makes any sense.

Will try to get this sorted (pun intended) in the next few weeks!