### Installing Light Switch Plugin via Composer (Bash) Source: https://github.com/awcodes/light-switch/blob/1.x/README.md This command installs the `awcodes/light-switch` package using Composer, the dependency manager for PHP. It's the standard way to add the plugin to your Filament project. ```bash composer require awcodes/light-switch ``` -------------------------------- ### Setting Light Switch Plugin Position in Filament Panel (PHP) Source: https://github.com/awcodes/light-switch/blob/1.x/README.md This example demonstrates how to change the default position of the Light Switch component on authentication pages. It uses the `position()` method with a case from the `Alignment` enum to specify the desired location. ```php use Awcodes\LightSwitch\LightSwitchPlugin; use Awcodes\LightSwitch\Enums\Alignment; public function panel(Panel $panel): Panel { return $panel ->plugins([ LightSwitchPlugin::make() ->position(Alignment::BottomCenter), ]); } // Available positions Alignment::TopLeft Alignment::TopCenter Alignment::TopRight Alignment::BottomLeft Alignment::BottomCenter Alignment::BottomRight ``` -------------------------------- ### Registering Light Switch Plugin in Filament Panel (PHP) Source: https://github.com/awcodes/light-switch/blob/1.x/README.md This PHP code snippet shows the basic registration of the Light Switch plugin within a Filament panel definition. The `LightSwitchPlugin::make()` method is called and added to the panel's plugins array to activate the default behavior. ```php use Awcodes\LightSwitch\LightSwitchPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ LightSwitchPlugin::make(), ]); } ``` -------------------------------- ### Enabling Light Switch Plugin on Specific Pages (PHP) Source: https://github.com/awcodes/light-switch/blob/1.x/README.md This snippet shows how to configure the Light Switch plugin to only appear on a defined set of authentication pages. The `enabledOn()` method accepts an array of route name strings, which are matched using `Str::contains()`. ```php use Awcodes\LightSwitch\LightSwitchPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ LightSwitchPlugin::make() ->enabledOn([ 'auth.email', 'auth.login', 'auth.password', 'auth.profile', 'auth.register', ]), ]); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.