Reference
- Activity
- Addresses
- Calls
- Chat
- Custom Field Groups
- Custom Fields
- Customers
- Deals
- Deliveries
- Email Marketing
- Features
- Files
- Invoices
- Labels
- Lead Sources
- Leads
- Lunches
- Meetings
- Monitoring
- Notes
- Orders
- Organisations
- PDF Templates
- People
- Permissions
- Pipelines
- Product Categories
- Product Variations
- Products
- Purchase Orders
- Quotes
- Roles
- Settings
- SMS Marketing
- Tasks
- Tax Rates
- Teams
- Users
Organisations
Overview
Organisations represent companies or business entities. An organisation can have multiple People associated with it, and can be linked to Leads, Deals, Orders, and other entities. The organisation name supports optional encryption for privacy.
Model: VentureDrake\LaravelCrm\Models\Organization
Table: {prefix}organizations (default: crm_organizations)
Attributes
| Attribute | Type | Description |
|---|---|---|
external_id |
string |
UUID used in URLs (auto-generated) |
name |
string |
Organisation name — encryptable |
description |
text |
Notes |
annual_revenue |
integer |
Annual revenue (stored in cents) |
total_money_raised |
integer |
Total funding raised (stored in cents) |
number_of_employees |
integer |
Employee count |
organization_type_id |
integer |
Organisation type |
timezone_id |
integer |
Timezone |
user_owner_id |
integer |
Owner user |
Note: Money fields (
annual_revenue,total_money_raised) are stored in cents. Thenamefield is encrypted at rest whenencrypt_db_fieldsis enabled.
Relationships
| Method | Type | Related Model | Description |
|---|---|---|---|
people() |
hasMany |
Person |
Associated people |
deals() |
hasMany |
Deal |
Associated deals |
emails() |
morphMany |
Email |
Email addresses |
phones() |
morphMany |
Phone |
Phone numbers |
addresses() |
morphMany |
Address |
Physical addresses |
labels() |
morphToMany |
Label |
Labels/tags |
contacts() |
morphMany |
Contact |
Contact records |
client() |
morphOne |
Customer |
v1 leftover; throws a QueryException — see Customers |
organizationType() |
belongsTo |
OrganizationType |
Type classification |
timezone() |
belongsTo |
Timezone |
Timezone |
ownerUser() |
belongsTo |
User |
Owner |
Related Contacts
Since 2.5.0, saving a lead, deal, quote, order, invoice or purchase order with both a contact person and an organization links the two as related contacts, so each one lists the other on its show page. See People → Related contacts.
Helper Methods
| Method | Returns | Description |
|---|---|---|
getPrimaryEmail() |
Email|null |
Primary email address |
getPrimaryPhone() |
Phone|null |
Primary phone number |
getPrimaryAddress() |
Address|null |
Primary address |
getBillingAddress() |
Address|null |
Billing address (type 5) |
getShippingAddress() |
Address|null |
Shipping address (type 6) |
Creating an Organisation
use VentureDrake\LaravelCrm\Models\Organization;
$org = Organization::create([
'name' => 'Acme Corp',
'description' => 'Software company',
'annual_revenue' => 1000000, // Stored in cents
'user_owner_id' => auth()->id(),
]);
Searching & Filtering
Searchable by name. Filterable by user_owner_id and labels.id. Sortable by id, name, created_at, and updated_at.
Traits
| Trait | Description |
|---|---|
SoftDeletes |
Soft delete support |
LaravelEncryptableTrait |
Field-level encryption |
BelongsToTeams |
Multi-tenant team scoping |
HasCrmFields |
Custom field support |
SearchFilters |
Search and filter capabilities |
Sortable |
Column sorting |
HasCrmActivities |
Activity timeline tracking |
HasCrmUserRelations |
Standard user tracking relations |