MedicOneSystems / livewire-datatables

Advanced datatables using Laravel, Livewire, Tailwind CSS and Alpine JS
https://livewire-datatables.com/
MIT License
1.19k stars 258 forks source link

Added defaultFilters to Livewire Datatables #527

Closed Cosnavel closed 1 year ago

Cosnavel commented 1 year ago

Added defaultFilters. The defaultFilters should be an Array of column names and the default filter value to use for. When a persisted filter ($this->persistFilters is true and session values are available) is available, it will override the default filters.

Example Usage: ```php '0', ]; public function builder() { return User::query()->withTrashed(); } public function columns() { $columns = [ NumberColumn::name('ID'), BooleanColumn::name('deleted_at')->filterable()->label(__('Deleted')), ]; return $columns; } } ``` **In Action:** https://user-images.githubusercontent.com/42392570/204001609-30f80de7-ea8e-476e-ad47-c5b630eaa07d.mp4

Refs & Closes #78

Cosnavel commented 1 year ago

Would love any feedback and review on it 😊

thyseus commented 1 year ago

Looks good to me. Could you please add a line to CHANGELOG.md and a small documentation block/example into README.md and i will merge it. And do a new release.

Thanks a lot !

Cosnavel commented 1 year ago

@thyseus added some documentation for the Readme. Does this work for you? What do you expect for the Changelog? Currently, there's not much into there 😛

thyseus commented 1 year ago

Very good. Thanks a lot for your contribution !

Cosnavel commented 1 year ago

@thyseus when do you plan to release the next tag?

thyseus commented 1 year ago

https://github.com/MedicOneSystems/livewire-datatables/releases/tag/v0.10.0