# Search

<figure><img src="/files/EjloU99Vq8It0uK7yraL" alt=""><figcaption></figcaption></figure>

on some views we need to get data from APIs and view it as Object!, and that's what this component does when you search it does a query on the remote URL and returns with an array of objects that you can select any object and it's filled with the object not just the ID

you can use it like this

```markup
<x-tomato-search
    :remote-url="route('admin.orders.user')"
    remote-root="data"
    name="account_id"
    placeholder="{{__('Select Account')}}"
    label="{{__('Account')}}"
/>
<div v-if="form.errors.account_id"
     class="text-danger-500 mt-2 text-xs font-chakra flex gap-2 mb-[6px]">
    <p v-text="form.errors.account_id"> </p>
</div>
<div v-if="form.account_id">
    <div class="text-lg font-bold mt-2">
        @{{form.account_id.name}}
    </div>
    <div class="text-sm">
        @{{form.account_id.email}}
    </div>
    <div class="text-sm">
        @{{form.account_id.phone}}
    </div>
    <div class="text-sm">
        @{{form.account_id.address}}
    </div>
    <div class="text-sm">
        @{{form.account_id.zip}} @{{form.account_id.city}}
    </div>
    <div class="text-sm">
        @{{form.account_id.country?form.account_id.country.name:''}}
    </div>
</div>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tomatophp.com/tomato-admin/inputs/search.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
