### Install filament-topbar with Composer Source: https://github.com/jeffersongoncalves/filament-topbar/blob/3.x/resources/boost/skills/filament-topbar-development/SKILL.md Install the Filament Topbar plugin via Composer. Requires Filament v3.0 or later. ```bash composer require jeffersongoncalves/filament-topbar:"^3.0" ``` -------------------------------- ### Install Filament Topbar via Composer Source: https://github.com/jeffersongoncalves/filament-topbar/blob/3.x/README.md Install the Filament Topbar plugin via Composer. Requires PHP 8.2+ and Filament 5.x. The package automatically registers its service provider and replaces the default topbar component. ```bash composer require jeffersongoncalves/filament-topbar:^3.0 ``` -------------------------------- ### Run Filament Topbar Tests Source: https://github.com/jeffersongoncalves/filament-topbar/blob/3.x/README.md Run the package's test suite. ```bash composer test ``` -------------------------------- ### TopbarServiceProvider Package Configuration Source: https://github.com/jeffersongoncalves/filament-topbar/blob/3.x/resources/boost/skills/filament-topbar-development/SKILL.md Defines the package service provider using Spatie's PackageServiceProvider. It configures the package name and registers views. ```php namespace JeffersonGoncalves\Filament\Topbar; use Spatie\LaravelPackageTools\Package; use Spatie\LaravelPackageTools\PackageServiceProvider; class TopbarServiceProvider extends PackageServiceProvider { public function configurePackage(Package $package): void { $package ->name('filament-topbar') ->hasViews(); } } ``` -------------------------------- ### TopbarPlugin Class Implementation Source: https://github.com/jeffersongoncalves/filament-topbar/blob/3.x/resources/boost/skills/filament-topbar-development/SKILL.md Defines the TopbarPlugin class. It enables topbar mode, switches to top navigation, and replaces the default topbar with the custom Livewire component. ```php namespace JeffersonGoncalves\Filament\Topbar; use Filament\Contracts\Plugin; use Filament\Panel; use JeffersonGoncalves\Filament\Topbar\Livewire\Topbar; class TopbarPlugin implements Plugin { public static function make(): static { return app(static::class); } public function getId(): string { return 'topbar'; } public function register(Panel $panel): void { $panel ->topbar() ->topNavigation() ->topbarLivewireComponent(Topbar::class); } public function boot(Panel $panel): void {} } ``` -------------------------------- ### Publish Filament Topbar Views Source: https://github.com/jeffersongoncalves/filament-topbar/blob/3.x/README.md Publish the topbar Blade view for customization. The view is published to resources/views/vendor/filament-topbar/components/topbar.blade.php. ```bash php artisan vendor:publish --tag="filament-topbar-views" ``` -------------------------------- ### Clear view cache with artisan view:clear Source: https://github.com/jeffersongoncalves/filament-topbar/blob/3.x/resources/boost/skills/filament-topbar-development/SKILL.md Run this command to clear the view cache after modifying published views. This is necessary when custom view changes are not reflecting due to caching. ```bash php artisan view:clear ``` -------------------------------- ### Livewire Topbar Component Source: https://github.com/jeffersongoncalves/filament-topbar/blob/3.x/resources/boost/skills/filament-topbar-development/SKILL.md Defines the custom Livewire Topbar component. It implements HasActions and HasSchemas, uses menu traits, listens for the 'refresh-topbar' event, and renders the topbar Blade view. ```php namespace JeffersonGoncalves\Filament\Topbar\Livewire; use Filament\Actions\Concerns\InteractsWithActions; use Filament\Actions\Contracts\HasActions; use Filament\Livewire\Concerns\HasTenantMenu; use Filament\Livewire\Concerns\HasUserMenu; use Filament\Schemas\Concerns\InteractsWithSchemas; use Filament\Schemas\Contracts\HasSchemas; use Illuminate\Contracts\View\View; use Livewire\Attributes\On; use Livewire\Component; class Topbar extends Component implements HasActions, HasSchemas { use HasTenantMenu; use HasUserMenu; use InteractsWithActions; use InteractsWithSchemas; #[On('refresh-topbar')] public function refresh(): void {} public function render(): View { return view('filament-topbar::livewire.topbar'); } } ``` -------------------------------- ### Dispatch refresh-topbar event in Livewire Source: https://github.com/jeffersongoncalves/filament-topbar/blob/3.x/resources/boost/skills/filament-topbar-development/SKILL.md Dispatch this event from any Livewire component to force the topbar to re-render. Use it when you need to update the topbar dynamically after a state change. ```php $this->dispatch('refresh-topbar'); ``` -------------------------------- ### Register TopbarPlugin in AdminPanelProvider Source: https://github.com/jeffersongoncalves/filament-topbar/blob/3.x/README.md Add the TopbarPlugin to your Filament panel's AdminPanelProvider.php. This registers the custom topbar component that replaces the default one. ```php use JeffersonGoncalves\Filament\Topbar\TopbarPlugin; ->plugins([ TopbarPlugin::make(), ]) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.