Panel > Resources > Global Search > Returning API data
Panels5️⃣v5
I have a bunch of Filament resources and some custom pages which render out API data. I was wondering if it would be possible to implement the global search also for the pages which render out the API data.
public static function getGlobalSearchEloquentQuery(): Builder{ return parent::getGlobalSearchEloquentQuery()->with(['author', 'category']);}
public static function getGlobalSearchEloquentQuery(): Builder{ return parent::getGlobalSearchEloquentQuery()->with(['author', 'category']);}
Would it be possible to add a hacky way for my custom page to get the same functionallity?
public static function getGlobalSearchEloquentQuery(): ?array{ return Http::get('myurl.com')->json()->attributes; // map so it returns url => name to show on the screen}
public static function getGlobalSearchEloquentQuery(): ?array{ return Http::get('myurl.com')->json()->attributes; // map so it returns url => name to show on the screen}
Of course I would need to return more than just a name, but rather an array perhaps with URL => name to show ?