You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The response structure is like:
"searchable": {whole model}
"title"
"url"
"type"
The question is How to get response without loading whole model in searchable? I dont need the searchable object in response. So How can I modify response?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Model Manufacturer
public function getSearchResult(): SearchResult
{
$url = route('manufacturers.show', $this->id);
Model Trademark
public function getSearchResult(): SearchResult
{
$url = route('trademarks.show', $this->id);
GlobalSearchController
public function search(GlobalSearchRequest $request)
{
$input = $request->validated();
The response structure is like:
"searchable": {whole model}
"title"
"url"
"type"
The question is How to get response without loading whole model in searchable? I dont need the searchable object in response. So How can I modify response?
Beta Was this translation helpful? Give feedback.
All reactions