PHP code example of attargah / admin-bar

1. Go to this page and download the library: Download attargah/admin-bar 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/ */

    

attargah / admin-bar example snippets


use Attargah\AdminBar\AdminBarPlugin;

->plugins([AdminBarPlugin::make()])

AdminBarPlugin::make()
    ->setBarTextColor('text-white')
    ->setBarBackgroundColor('bg-gray-900')
    ->setBarCustomClass('')
    ->setBarHeight('h-12')
    ->setBarTitleFont('font-bold text-lg')
    ->setBarMenuItemsFont('text-sm')
    ->setBarMenuTitleFont('uppercase')
    ->setBarTitle('Admin Panel')
    ->setAuthMenuEnable(true)
    ->setLogoHeight('h-8')
    ->setLogoUrl('https://example.com/image.png')

use Filament\Panel;
use Filament\Support\Facades\FilamentView;
use Attargah\AdminBar\Enums\AdminBarRenderHook;

FilamentView::registerRenderHook(
    AdminBarRenderHook::BETWEEN_AUTH_MENU_ITEMS,
    fn () => '
        <li>
            <a href="'.route('settings-route').'"
               class="block break-words whitespace-normal px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">
                Settings
            </a>
        </li>
    ',
);
bash
php artisan vendor:publish --provider="Attargah\AdminBar\AdminBarServiceProvider"
bash
php artisan vendor:publish --tag=admin-bar-translations