awcodes / filament-sticky-header

A Filament Panels plugin to make headers sticky when scrolling.
MIT License
63 stars 10 forks source link

Support closures in `floating()` and `colored()` methods #25

Closed rhiannonjourney closed 1 year ago

rhiannonjourney commented 1 year ago

This pull request adds support for passing a closure to the floating() and colored() methods.

I think all of the changes are pretty straightforward, but I did have to move the FilamentAsset::registerScriptData() call into the boot() method instead of the register() method because certain things, like accessing auth()->user(), don't work if the closures are evaluated when the plugin is registered.

awcodes commented 1 year ago

Thanks