Skip to content

Register Commands

Use the RegisterCommands provider to automatically register all provided commands.

This includes

  • LogoutCommand
  • ToggleThemeCommand
  • ToggleSidebarCommand
  • ChangeTenantCommand and TenantQuery (only if your application supports multi-tenancy)
php
use pxlrbt\FilamentSpotlightPro\SpotlightPlugin;
use pxlrbt\FilamentSpotlightPro\SpotlightProviders\RegisterCommands;use pxlrbt\FilamentSpotlightPro\SpotlightProviders\RegisterPages;

$panel->plugins([
    SpotlightPlugin::make()->registerItems([
        RegisterCommands::make()
    ])
])

Excluding Commands

You can also exclude commands by passing an array of command classes to the ->except(). method:

php
use pxlrbt\FilamentSpotlightPro\SpotlightCommands\ToggleSidebarCommand;

SpotlightPlugin::make()->registerItems([
    RegisterPages::make()->except([
        ToggleSidebarCommand::class
    ])
])

Register Single Commands

Instead of excluding commands, you can also register just the commands you need:

php
use pxlrbt\FilamentSpotlightPro\SpotlightCommands\ToggleSidebarCommand;

SpotlightPlugin::make()->registerItems([
    ToggleSidebarCommand::class
])