Overview
TheCompanyDetail model (app/Models/CompanyDetail.php:27) provides a flexible key-value store for company information within each tenant.
Company details are stored at the tenant level, not workspace level. All workspaces within a tenant share the same company details.
Company Detail Fields
Common company detail keys:| Key | Description | Example |
|---|---|---|
name | Legal company name | ”Óptica Modelo S.R.L.” |
comercial_name | Commercial/trading name | ”Óptica Modelo” |
rnc | Tax ID (RNC for Dominican Republic) | “131-12345-6” |
address | Physical address | ”Av. Principal #123, Santo Domingo” |
phone | Primary phone number | ”(809) 555-1234” |
email | Contact email | ”[email protected]” |
website | Company website | ”https://opticamodelo.com” |
logo | Logo file path | ”logos/company-logo.png” |
tax_rate | Default tax rate | ”18” |
currency | Default currency code | ”DOP” |
Custom Fields
You can store any custom key-value pairs:Setting Up Company Information
Using the Controller
TheCompanyDetailsController (app/Http/Controllers/CompanyDetailsController.php:15) handles company detail management:
Edit Company Information
The edit form displays current company details with fields for:
- Basic information (name, RNC, address)
- Contact details (phone, email, website)
- Logo upload
- Tax and currency settings
Programmatic Access
TheCompanyDetail model provides convenient static methods:
Using UpdateCompanyDetailsAction
The recommended way to update company details:- Validates the input data
- Handles logo file upload if provided
- Updates all company detail records
- Returns success/failure status
Logo Management
Uploading a Company Logo
Logos are stored in tenant-specific storage:Displaying the Logo
Use thetenant_asset() helper to generate the correct URL:
Using Company Details in Documents
In Invoice Generation
Company details are typically used when generating invoices, quotations, and receipts:In PDF Templates
Access company details in Blade templates:In Email Templates
Include company details in email notifications:Dominican Republic Specific: RNC
RNC Format
The RNC (Registro Nacional de Contribuyentes) is the Dominican tax identification number. Format:- Format:
XXX-XXXXX-X(9 digits with dashes) - Example:
131-12345-6
RNC Validation
Implement RNC validation in your form request:DGII Integration
OptiFlow can sync RNC data from DGII (Dominican tax authority) using thesync:dgii command. See Integrations - DGII Sync for details.
Company Details Per Workspace
While company details are tenant-wide, you can implement workspace-specific overrides:Workspace-specific company details are not built-in but can be implemented using workspace settings as shown above.
Best Practices
- Complete Information: Fill out all relevant company details for professional-looking documents
- Logo Optimization: Use optimized image files (PNG/SVG) for logos, max 500KB
- Consistent Formatting: Use consistent phone number and address formats
- Backup: Include company details in your backup strategy
- Validation: Always validate RNC and other tax IDs according to local requirements
- Multi-language: Consider storing translated versions for multi-language support
Example: Complete Setup
Related Resources
- Workspace Management - Managing workspaces
- Document Subtypes - NCF configuration for invoices
- Integrations - DGII data synchronization