Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/0m1n3m/contacts-db/llms.txt

Use this file to discover all available pages before exploring further.

The Contacts module is the core of Contacts DB. It stores every person and organisation your team tracks — from partners and speakers to stakeholders and prospects. Users with any role can view contacts; the admin and editor roles can create and update them; only admins can delete them or run bulk operations. Every record is structured around a rich set of fields that covers identity, contact details, classification, and free-text notes.

Data Model

The contacts table is created by migration 2026_04_20_132419_create_contacts_table. The table below documents every column.
FieldTypeRequiredDescription
idbigint (auto-increment)Primary key, assigned automatically.
contact_categorystring (varchar 255)✅ YesHigh-level classification of the contact (e.g. Partner, Donor, Media). Indexed.
relationship_statusstring (varchar 255)✅ YesCurrent status of the relationship (e.g. Active, Prospect, Lapsed). Indexed.
use_for_eventsbooleanNoFlag indicating this contact should be considered for event invitations. Defaults to false.
potential_speakerbooleanNoFlag indicating this contact is a potential event speaker. Defaults to false.
organisation_namestring (varchar 255)NoName of the contact’s organisation or employer. Indexed.
first_namestring (varchar 255)NoContact’s given name. Indexed.
last_namestring (varchar 255)NoContact’s family name. Indexed.
job_titlestring (varchar 255)NoContact’s role or job title.
emailsjson (array)NoOne or more email addresses stored as a JSON array.
phonesjson (array)NoOne or more phone numbers stored as a JSON array.
countrystring (ISO 3166-1 alpha-2)NoTwo-letter ISO country code (e.g. GB, US, DE). Indexed.
organisation_typesjson (array)NoCategories describing the type of organisation (e.g. NGO, University).
keywordsjson (array)NoThematic tags for the contact (e.g. climate, policy).
relevant_project_programmestring (varchar 255)NoName of the project or programme this contact is linked to.
expertise_speaking_topicstext (json array)NoAreas of expertise or speaking topics, stored as a JSON array.
stakeholder_typestring (varchar 255)NoStakeholder classification (e.g. Funder, Government, Civil Society). Indexed.
commenttextNoFree-text notes about the contact.
created_attimestampSet automatically by Laravel when the record is created.
updated_attimestampUpdated automatically by Laravel on every save.

JSON Array Fields

Five columns store multiple values as JSON arrays in the database. Laravel’s Eloquent model casts these columns automatically so they are always PHP arrays in application code:
ColumnCast
emailsarray
phonesarray
organisation_typesarray
keywordsarray
expertise_speaking_topicsarray
An example JSON representation of a single contact’s multi-value fields:
{
  "emails": ["alice@example.com", "alice@work.org"],
  "phones": ["+44 20 7946 0958"],
  "organisation_types": ["NGO", "Think Tank"],
  "keywords": ["climate", "policy", "NGO"],
  "expertise_speaking_topics": ["Climate Finance", "Carbon Markets"]
}
In the create and edit forms, each JSON array field is presented as a textarea where you type one value per line. Each non-blank line becomes a separate element in the stored array. When exported to CSV, these columns are serialised back to a JSON string.

Filtering

The contact list at /contacts supports both a global search parameter and per-column filters, all passed as URL query parameters.

Global search — q

The q parameter performs a broad LIKE search across all text columns simultaneously, including the JSON array columns. It also resolves country names — typing “Germany” matches contacts whose country field is DE.

Column filters

The following columns accept a text LIKE (partial match) filter via their query parameter:
ParameterColumnMatch type
contact_categorycontact_categoryContains (case-insensitive)
relationship_statusrelationship_statusContains
first_namefirst_nameContains
last_namelast_nameContains
organisation_nameorganisation_nameContains
job_titlejob_titleContains
countrycountryExact ISO code or partial country name
relevant_project_programmerelevant_project_programmeContains
stakeholder_typestakeholder_typeContains
commentcommentContains

Boolean filters

ParameterAccepted values
use_for_events1 / true / yes or 0 / false / no
potential_speaker1 / true / yes or 0 / false / no

JSON array filters

The emails, phones, keywords, organisation_types, and expertise_speaking_topics parameters search inside the stored JSON string, matching contacts whose array contains an element equal to the supplied value.

Sorting

The sort parameter accepts any column from the allowed list, and dir accepts asc or desc. String columns are sorted case-insensitively with leading spaces trimmed. The default sort is updated_at descending. Sortable columns: contact_category, relationship_status, use_for_events, potential_speaker, organisation_name, first_name, last_name, job_title, country, relevant_project_programme, stakeholder_type, created_at, updated_at.

Access Control

Contacts DB enforces role-based access on every contact route. The three roles and their permissions are:
ActionAdminEditorViewer
View contact list (GET /contacts)
View contact detail (GET /contacts/{id})
Create contact (GET/POST /contacts/create)
Edit contact (GET /contacts/{id}/edit, PATCH /contacts/{id})
Delete single contact (DELETE /contacts/{id})
Bulk delete (POST /contacts/bulk-destroy)
Export selected contacts (POST /contacts/export)
Import contacts (GET /contacts/import, POST /contacts/import/preview, POST /contacts/import/run)
The viewer role is any authenticated user who is not assigned the admin or editor role. Export is available to all authenticated users — no special role is required.

Managing Contacts

Learn how to create, edit, search, and delete contacts from the UI and via direct HTTP routes.

Import & Export

Bulk-import contacts from CSV or Excel files and export selected records to CSV.

Build docs developers (and LLMs) love