protonemedia / laravel-cross-eloquent-search

Laravel package to search through multiple Eloquent models. Supports sorting, pagination, scoped queries, eager load relationships and searching through single or multiple columns.
https://protone.media/blog/search-through-multiple-eloquent-models-with-our-latest-laravel-package
MIT License
1.1k stars 80 forks source link

Check if updated_at column is defined #39

Closed MeiKatz closed 2 years ago

MeiKatz commented 3 years ago

While on my research about how to implement this package for SQLite3 I discovered that it has a fallback on to the updated_at column for ordering if no column was specified. I think we should check if ->timestamps is true and otherwise maybe fallback to the primary column? Or maybe any other column that is definitely defined

pascalbaljet commented 2 years ago

I've opened a PR (#44) to address this, but it's a breaking change, so I'll keep it open until the next major release.

pascalbaljet commented 2 years ago

Fixed in v3.0.0.