diff --git a/src/Commands/ResourceCommand.php b/src/Commands/ResourceCommand.php index cf13344..a08c54c 100644 --- a/src/Commands/ResourceCommand.php +++ b/src/Commands/ResourceCommand.php @@ -110,7 +110,7 @@ public function searchRecord($query): EloquentCollection|Collection|array ->limit(50) ->get() ->map(fn (Model $record) => new SpotlightSearchResult( - $record->getKey(), + $record->getRouteKey(), $resource::getGlobalSearchResultTitle($record), collect($resource::getGlobalSearchResultDetails($record)) ->map(fn ($value, $key) => $key.': '.$value)