PHP code example of muazzambuilds / filament-white-label

1. Go to this page and download the library: Download muazzambuilds/filament-white-label 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/ */

    

muazzambuilds / filament-white-label example snippets


use MuazzamBuilds\FilamentWhiteLabel\WhiteLabelPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugin(
            WhiteLabelPlugin::make()
                ->navigationGroup('Settings')
                ->navigationSort(99)
                ->authorize(fn (): bool => auth()->user()?->is_admin ?? true),
        );
}

WhiteLabelPlugin::make()
    ->navigationLabel('Appearance')
    ->navigationIcon('heroicon-o-paint-brush')
    ->authorize(fn (): bool => auth()->user()->can('manage-branding'));

// config/filament-white-label.php

return [
    'navigation_group' => 'Settings',
    'navigation_sort' => 99,
    'navigation_icon' => 'heroicon-o-swatch',

    'disk' => 'public',
    'directory' => 'white-label',

    'cache' => [
        'enabled' => true,
        'ttl' => 3600,
        'key_prefix' => 'filament-white-label',
    ],

    'custom_css_max_length' => 50000,

    'defaults' => [
        // brand_name, logos, colors, layout, behavior, footer, custom_css…
    ],
];
bash
php artisan vendor:publish --tag=filament-white-label-config
php artisan migrate
php artisan storage:link