PHP code example of alenadashko / filament-color-themes

1. Go to this page and download the library: Download alenadashko/filament-color-themes 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/ */

    

alenadashko / filament-color-themes example snippets


use AlenaDashko\FilamentColorThemes\ColorThemesPlugin;

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

use AlenaDashko\FilamentColorThemes\ColorThemesPlugin;
use AlenaDashko\FilamentColorThemes\Http\Middleware\ApplyColorTheme;

return $panel
    ->plugin(ColorThemesPlugin::make())
    ->middleware([
        ApplyColorTheme::class,
    ], isPersistent: true);

return $panel
    ->colors([
        'primary' => '#ED1A38',
    ])
    ->plugin(ColorThemesPlugin::make());

->plugin(
    ColorThemesPlugin::make()
        ->overridePanelColors()
)

->plugin(
    ColorThemesPlugin::make()
        ->canView(fn (): bool => auth()->user()?->isAdmin() ?? false)
)
bash
php artisan filament:optimize-clear
php artisan optimize:clear
php artisan view:clear
bash
php artisan vendor:publish --tag="filament-color-themes-config"
php artisan vendor:publish --tag="filament-color-themes-translations"