outl1ne / nova-detached-filters

This Laravel Nova package allows you to detach filters from the filter dropdown and show them on a card
MIT License
61 stars 21 forks source link

excluding filters #2

Closed Dontorpedo closed 4 years ago

Dontorpedo commented 4 years ago

Hi,

right now the filters visible as detached filters have to been defined also in the filter function, so they are present in both as normal filter AND as detached filters, it would much nicer to have a function to make some filters invisible in the normal filter.. so i can use detached filters for often used things and the normal filter place for not often used things..

thanks Denis

KasparRosin commented 4 years ago

Hey!

This was my initial wish, having users only define filters where they want them to show up (either on card or in filter dropdown). Unfortunately I haven't been able to come up with a good solution to this.

One of the solutions i thought of was adding a "hidden" property to the filters that are only defined in DetachedFilter card. And then overriding filter-menu component and not rendering the filters that have "hidden" property.

Maybe you or some other users have better suggestions or ideas how to solve this issue more efficiently, otherwise i'll implement the solution above.

Best Kaspar

KasparRosin commented 4 years ago

This feature is now available in 1.0.4. Make sure you use use HasDetachedFilters trait in your resource to access this functionality.

More documentation can be found in README.md