> For the complete documentation index, see [llms.txt](https://queents.gitbook.io/vilt/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://queents.gitbook.io/vilt/components/relation.md).

# Relation

<figure><img src="https://598543987-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3nnlrjn6TtcCpL6SXFhI%2Fuploads%2FNa2IAIJWRvPhYvk5jbqg%2FScreenshot%202022-10-31%20at%201.43.53%20PM.png?alt=media&amp;token=17f2718b-b267-411b-b24b-25f1946b11b9" alt=""><figcaption></figcaption></figure>

you can use `Relation::class` to build a select input like this

```php
Relation::make('name');
```

this class works with vue `ViltRelation.vue`

it has some more methods for setting options

```php
->options(array) //you can use Options::class to add new options or array ["name"=>"", "id"=>""]
->trackByName(string)
->trackById(string)
->relation(string)
->multi(true)
->model(Model::class)
```

### Custom Query

to custom the query when you call the API you can use this method

```php
->query('customer_id', '=', 1)
```
