jeffersongoncalves/filament-topbar
Filament plugin that replaces the default topbar with an enhanced, responsive topbar showing navigation and user UI elements in better positions. Zero-config: install and it auto-integrates with existing panels. Requires PHP 8.2+ and Filament 5.x.
Installation:
composer require jeffersongoncalves/filament-topbar:^3.0
Enable in Admin Panel:
Add the plugin to your AdminPanelProvider.php:
use JeffersonGoncalves\Filament\Topbar\TopbarPlugin;
->plugins([
TopbarPlugin::make(),
])
First Use Case:
Basic Integration:
Customizing the Topbar View:
php artisan vendor:publish --tag="filament-topbar-views"
resources/views/vendor/filament-topbar/components/topbar.blade.php.Adding Custom Elements:
// In your AdminPanelProvider.php
TopbarPlugin::make()
->customTopbarContent(function () {
return view('custom.topbar-content');
})
Conditional Rendering:
TopbarPlugin::make()
->showOnPages(function ($page) {
return $page instanceof YourCustomPage;
})
Theming:
Iterative Development:
php artisan view:clear to refresh Blade views after modifications.Plugin Composition:
TopbarPlugin::make()
->extraTopbarItems([
YourCustomTopbarItem::class,
])
Localization:
__() helper.Filament Widgets:
TopbarPlugin::make()
->widgets([
YourTopbarWidget::class,
])
Responsive Adjustments:
@stack('topbar.right')) to manage mobile/desktop layouts.Event Listeners:
TopbarRendered) to dynamically alter topbar content:
event(new TopbarRendered($topbar));
Filament Version Compatibility:
^5.3) matches the plugin’s requirements. Downgrade if needed:
composer require filament/filament:^5.3
Caching Issues:
php artisan filament:cache:clear
Blade Component Conflicts:
topbar).Mobile Responsiveness:
View Overrides Not Applying:
resources/views/vendor/filament-topbar/components/topbar.blade.php).@stack vs @push).Plugin Not Loading:
TopbarPlugin::make() is added to the plugins() array in AdminPanelProvider.composer dump-autoload
CSS/JS Conflicts:
.filament-topbar.Extending Functionality:
public function boot()
{
Topbar::macro('addCustomItem', function () {
// Custom logic
});
}
Performance:
Testing:
$this->filament()->assertSeeInTopbar('Expected Text');
Dark Mode:
dark: variants to your custom CSS classes.Accessibility:
Backup Original Topbar:
cp vendor/jeffersongoncalves/filament-topbar/resources/views/components/topbar.blade.php resources/views/vendor/filament-topbar/components/topbar.original.blade.php
How can I help you explore Laravel packages today?