File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments