PHP code example of filafly / filament-logo-tools

1. Go to this page and download the library: Download filafly/filament-logo-tools 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/ */

    

filafly / filament-logo-tools example snippets


use Filafly\LogoTools\LogoToolsPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugin(LogoToolsPlugin::make());
}

LogoToolsPlugin::make()
    ->iconLogo('img/icon.svg')
    ->darkModeIconLogo('img/icon-dark.svg')
    ->iconLogoHeight('1.5rem')

// Image path
->iconLogo('img/icon.svg')

// Inline SVG
->iconLogo(fn () => new HtmlString('<svg ...>...</svg>'))

->iconLogoHeight('2rem')

// Default dark/light inversion
->logoSectionBackground()

// Filament color (array)
->logoSectionBackground(Color::Blue)

// Filament color name
->logoSectionBackground('primary')

// Hex code
->logoSectionBackground('#1e3a5f')

// CSS color function
->logoSectionBackground('oklch(0.5 0.2 240)')

// Tailwind class
->logoSectionBackground('bg-gray-900')

// Default subtle black border
->logoSectionBorder()

// Custom color (e.g. for use with logoSectionBackground)
->logoSectionBorder('rgb(255 255 255 / 0.1)')

->logoSectionPadding('1rem')

->collapsedLogoSectionWidth('5.5rem')

use Filafly\LogoTools\Enums\CollapseButtonPosition;

->collapseButtonPosition(CollapseButtonPosition::Right)

use Filafly\LogoTools\Enums\CollapseButtonStyle;

->collapseButtonStyle(CollapseButtonStyle::Circle)   // full circle (default)
->collapseButtonStyle(CollapseButtonStyle::Rounded)  // slightly rounded corners
->collapseButtonStyle('square')                      // sharp corners

use Filament\Support\Icons\Heroicon;

// Enum
->expandButtonIcon(Heroicon::OutlinedChevronRight)

// String
->expandButtonIcon('heroicon-o-arrow-right')

->collapseButtonIcon(Heroicon::OutlinedChevronLeft)

use Filafly\LogoTools\LogoToolsPlugin;
use Filafly\LogoTools\Enums\CollapseButtonStyle;
use Filament\Support\Colors\Color;

->plugin(
    LogoToolsPlugin::make()
        ->iconLogo('img/icon.svg')
        ->darkModeIconLogo('img/icon-dark.svg')
        ->iconLogoHeight('1.25rem')
        ->logoSectionBackground(Color::Blue)
        ->logoSectionBorder('rgb(255 255 255 / 0.1)')
        ->logoSectionPadding('0.5rem')
        ->collapsedLogoSectionWidth('5.5rem')
        ->collapseButtonStyle('rounded')
        ->expandButtonIcon('heroicon-o-arrow-right')
        ->collapseButtonIcon('heroicon-o-arrow-left')
)
bash
php artisan filament:assets