页面 · Laravilt
AI Columns
Describe resource columns so the model understands your data.
Laravilt\AI\AIColumn describes a column to the agent: its label, type, and whether it can be searched, filtered or sorted.
php
New columns are searchable by default. Filterable and sortable are off until you enable them.
Types
type() accepts any string. Use the types your model understands:
php
Options and relationships
php
Methods
| Method | Description |
|---|---|
make(string $name) | Create a column |
label(string) | Display label (defaults to the title-cased name with underscores as spaces) |
description(string) | Extra context |
type(string) | Data type |
searchable(bool) | Searchable (default true) |
filterable(bool) | Filterable |
sortable(bool) | Sortable |
options(array) | Allowed values |
relationship(string, string $titleColumn = 'name') | Related model |