Skip to content

Commit dc3181a

Browse files
committed
feat: update spotlight plugin integration
Replace free Spotlight plugin with conditional Pro version if available. Fallback to free version.
1 parent 319da3e commit dc3181a

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/Providers/AdminPanelProvider.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ public function panel(Panel $panel): Panel
128128
FilamentSpatieLaravelHealthPlugin::make()
129129
->usingPage(HealthCheckResults::class)
130130
->authorize(fn (): bool => auth()->user()->hasRole('super_admin')),
131-
SpotlightPlugin::make(),
132131
])
133132
->navigationGroups([
134133
NavigationGroup::make('Users'),
@@ -159,6 +158,19 @@ public function panel(Panel $panel): Panel
159158
->databaseNotifications()
160159
->unsavedChangesAlerts();
161160

161+
// If the Pro version of the Spotlight plugin is installed, use that, otherwise use the free version
162+
if (class_exists(\pxlrbt\FilamentSpotlightPro\SpotlightPlugin::class)) {
163+
/** @noinspection PhpFullyQualifiedNameUsageInspection */
164+
$panel->plugin(\pxlrbt\FilamentSpotlightPro\SpotlightPlugin::make()
165+
->registerItems([
166+
\pxlrbt\FilamentSpotlightPro\SpotlightProviders\RegisterResources::make(),
167+
])
168+
->hotkeys(['¸'])
169+
);
170+
} else {
171+
$panel->plugin(SpotlightPlugin::make());
172+
}
173+
162174
// Add plugins from the plugin registry
163175
foreach (app(Registry::class)->getPlugins() as $plugin) {
164176
$panel->plugin($plugin);

0 commit comments

Comments
 (0)