filament open and close nav using js

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     */
    public function register(): void
    {
        //
        FilamentView::registerRenderHook(
            PanelsRenderHook::BODY_END,
            function(){
                return "<script>
                document.addEventListener('alpine:init', function() {
                    // console.log(window.Alpine.store('sidebar').close());
                    window.Alpine.store('sidebar').close();
                   
                  });
                  </script>";
             
            }
        );

      
    }

    /**
     * Bootstrap any application services.
     */
    public function boot(): void
    {
        //
    }
}

Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *