# Create and Use an Attribute
Krayin is attribute-driven โ the fields you see on Leads, Persons, Organizations, Products, Quotes, and Warehouses are all Attribute records under the hood. Adding a custom field is a few clicks in the admin; no migrations, no code.
This page covers the admin flow: creating an attribute, picking its type, marking it for the Quick Add modal, and using it inside the matching module.
# ๐งฉ What you can build
| Capability | Detail |
|---|---|
| Per-entity custom fields | Leads, Persons, Organizations, Products, Quotes, Warehouses each get their own attribute set. |
| 12+ field types | Text, textarea, price, boolean, date, datetime, email, phone, select, multi-select, lookup, image, file, address โ plus Subheading for visual grouping. |
| Quick Add modal support | Mark an attribute as Quick Add and it shows up in the modal that opens from the entity's quick-create button. |
| Validation rules | Mark fields required, unique, or numeric directly from the form. |
| Default values | Pre-fill an attribute so users don't have to type it every time. |
# ๐๏ธ 1. Open the Attributes screen
In the admin:
- Open Settings from the sidebar.
- Click Attributes.
- You land on the list view โ every existing attribute, grouped by entity type.
# ๐ช 2. Create a new attribute
Click Create Attribute in the top-right corner. The create form opens.
Fill these fields:
| Field | Purpose |
|---|---|
| Code | Machine-readable identifier (e.g. industry). Used in code โ lowercase, no spaces. |
| Admin Name | Label shown to admin users. |
| Type | The field type โ see the table below. |
| Entity Type | Which module this attribute belongs to (Leads, Person, Organization, etc.). |
| Quick Add | Whether this field appears in the entity's Quick Add modal. See Quick Add. |
| Is Required | Force users to fill the field before saving. |
| Is Unique | Reject duplicate values across the module. |
| Default Value | Pre-fill the field on the create form. |
# Field types
| Type | Use for |
|---|---|
| Text | Short single-line input (e.g. Job Title). |
| Textarea | Multi-line input (e.g. Notes). |
| Price | Money values โ respects the configured currency. |
| Boolean | Yes/no toggle. |
| Date | Calendar picker, date only. |
| Datetime | Calendar picker with time. |
| Email input with validation. | |
| Phone | Phone-number input. |
| Select | Dropdown โ single choice. |
| Multiselect | Dropdown โ multiple choices. |
| Lookup | Reference another entity (e.g. tie an attribute to a Person record). |
| Image | Single image upload. |
| File | Single file upload. |
| Address | Composite address input (street, city, state, country, zip). |
| Subheading | Not a real field โ a section divider used to group related fields on the form. See Subheading. |
# ๐ท๏ธ Subheading
A Subheading is a layout-only attribute. It doesn't store data; it just renders a heading on the create/edit form so you can visually group fields that belong together.
Typical use: on the Lead form, group all Company attributes under a subheading called Company details, and all Contact attributes under Primary contact.
To add one:
- Set Type to
Subheading. - Give it an Admin Name โ this is the text the user sees on the form.
- Save.
- Drag the subheading into the position you want it in the Attribute Group layout.
Subheadings have no value
Because subheadings don't store data, the Is Required, Is Unique, Default Value, and Quick Add fields don't apply โ the admin form hides them when Type = Subheading.
# โก Quick Add
The Quick Add modal is the small create dialog you get when you click a quick-create button on a list view (for example, + Add Lead on a pipeline column). It's intentionally short โ only the highest-value fields appear.
Toggle Quick Add to Yes on an attribute to make it appear in that modal for the matching entity. Everything else lives only on the full create/edit page.
Good candidates for Quick Add:
- The handful of fields a user must fill to create the record (name, email, stage).
- Fields used for filtering or sorting on the list view.
Skip Quick Add for:
- Long text fields (Notes, Description).
- Optional / rarely-used metadata โ keep the modal compact.
You can still edit non-Quick-Add fields later
Disabling Quick Add for a field doesn't hide it โ it just keeps it off the modal. The field still appears on the full edit page where users can fill it in afterwards.
# ๐๏ธ 3. Arrange fields with Attribute Groups
If you've added several attributes to the same entity, group and order them via Settings โ Attribute Groups:
- Pick the entity (Leads, Person, etc.).
- Drag your attributes into the groups where they should appear.
- Drag groups themselves to reorder the sections on the form.
Subheadings show up here too โ drop them between groups of attributes to label the sections.
# ๐งช 4. Verify
- Go to the matching module (e.g. Leads if you created a Leads attribute).
- Open the create form โ your attribute should appear in its assigned group.
- If you enabled Quick Add, open the Quick Add modal from a pipeline column โ the attribute should be there too.
- Save a record with a value, then re-open it โ the value should persist.
If the attribute doesn't show up, clear caches:
php artisan optimize:clear
# ๐ Entity types at a glance
| Entity type | Module the attribute appears in |
|---|---|
| Leads | Lead create / edit / detail pages. |
| Person | Contact (Person) records. |
| Organization | Company / organization records. |
| Products | Product catalog entries. |
| Quotes | Quote line items and headers. |
| Warehouses | Warehouse records. |
# ๐ Next steps
- Make a Model Use Custom Attributes โ wire a custom package model into the attribute system so it can have its own attributes.
- Events Listeners โ hook into
settings.attribute.create.afterto react to new attributes from your package.