PHP code example of vitisstudio / filament-hover-sidebar

1. Go to this page and download the library: Download vitisstudio/filament-hover-sidebar library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vitisstudio / filament-hover-sidebar example snippets


use VitisStudio\FilamentHoverSidebar\HoverSidebarPlugin;

return $panel
    ->sidebarWidth('17rem')
    ->collapsedSidebarWidth('4.5rem')
    ->plugin(
        HoverSidebarPlugin::make()
            ->openDelay(90)
            ->closeDelay(180)
    );

use Filament\Support\Icons\Heroicon;

HoverSidebarPlugin::make()
    ->unpinnedIcon(Heroicon::OutlinedBars3)
    ->pinnedIcon('heroicon-s-x-mark')

it('expands the sidebar on hover without moving the content', function () {
    $page = visit('/admin');

    $before = $page->script('document.querySelector(".fi-main-ctn").getBoundingClientRect().left');

    $page->hover('#fi-main-sidebar')
        ->waitForText('Dashboard')
        ->assertScript(
            'document.querySelector(".fi-main-ctn").getBoundingClientRect().left',
            $before,
        );
});
bash
php artisan vendor:publish --tag="filament-hover-sidebar-translations"
bash
composer filament:assets