PHP code example of bezhansalleh / filament-panel-switch

1. Go to this page and download the library: Download bezhansalleh/filament-panel-switch 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/ */

    

bezhansalleh / filament-panel-switch example snippets


@source '../../../../vendor/bezhansalleh/filament-panel-switch/resources/views/**/*.blade.php';

use BezhanSalleh\PanelSwitch\PanelSwitch;

PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
    // Custom configurations go here
});

PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
    $panelSwitch->panels([
        'admin',
        'dev',
        'app'
    ]);
});

    PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
        $panelSwitch
            ->modalHeading('Available Panels')
            ->modalWidth('sm')
            ->slideOver();
    });
    

    PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
        $panelSwitch->simple();
    });
    

PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
    $panelSwitch
        ->labels([
            'admin' => 'Custom Admin Label',
            'general_manager' => __('General Manager')
        ]);
});

PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {    
    $panelSwitch->icons([
        'admin' => 'heroicon-o-square-2-stack',
        'app' => 'heroicon-o-star',
    ]);
});

PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {    
    $panelSwitch->icons([
        'admin' => 'https://example.com/admin.jpg',
        'app' => 'https://example.com/app.jpg',
    ], asImage: true);
});

PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
    $panelSwitch->iconSize(32); // 128px
});

PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
    $panelSwitch
        ->panels(['admin', 'dev', 'app'])
        ->sort();         // ascending: ['admin', 'app', 'dev']
        // ->sort('desc') // descending: ['dev', 'app', 'admin']
});

PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
    $panelSwitch->renderHook('panels::global-search.after');
});

use BezhanSalleh\PanelSwitch\PanelSwitch;

PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
    $panelSwitch
        ->panels(['admin', 'app', 'dev'])
        ->heading('Available Panels')
        ->modalWidth('sm')
        ->slideOver()
        ->icons([
            'admin' => 'heroicon-o-square-2-stack',
            'app' => 'heroicon-o-star',
        ])
        ->iconSize(16)
        ->labels([
            'admin' => 'Admin Panel',
            'app' => 'SaaS Application'
        ]);
        
});

"    "bezhansalleh/filament-panel-switch": "dev-fix/error-message as main-dev",
},
"repositories": [
    {
        "type": "path",
        "url": "filament-panel-switch"
    }
]
bash
php artisan vendor:publish --tag="filament-panel-switch-views"