Overview
The Company model represents a business entity in ElectroFix. Each company has its own users, customers, equipment, orders, inventory, and billing documents. This is the top-level organizational model in the system.Properties
Fillable Attributes
The company’s business name
Full name of the company owner
Email address of the company owner
Phone number of the company owner
Tax identification number for the company
Email address for billing communications
Phone number for billing inquiries
Street address of the company
City where the company is located
State or province of the company
Country where the company operates
Postal or ZIP code
Currency code used by the company (e.g., USD, EUR)
Default VAT/tax percentage for billing (stored with 2 decimal precision)
Additional notes or information about the company
Casts
vat_percentage field is automatically cast to a decimal with 2 decimal places.
Relationships
users()
Type:HasMany
Returns all users belonging to this company.
subscription()
Type:HasOne
Returns the active subscription for this company.
customers()
Type:HasMany
Returns all customers belonging to this company.
equipments()
Type:HasMany
Returns all equipment registered to this company.
orders()
Type:HasMany
Returns all repair orders for this company.
inventoryItems()
Type:HasMany
Returns all inventory items managed by this company.
inventoryMovements()
Type:HasMany
Returns all inventory movements tracked for this company.
billingDocuments()
Type:HasMany
Returns all billing documents (invoices, quotes, etc.) for this company.
aiUsages()
Type:HasMany
Returns all AI usage records for this company.
Usage Examples
Creating a New Company
Accessing Company Relationships
Updating Company Information
Source Reference
Model file:/home/daytona/workspace/source/app/Models/Company.php