Overview
TheActivo model represents physical assets (furniture, equipment) that are managed within the GIMA system. Each asset is linked to an article definition, has a location, tracks its operational state, and maintains relationships with maintenance records and reports.
Model Information
Database table name
App\Models\ActivoFillable Fields
The following fields can be mass-assigned:Foreign key reference to the
articulos table. Links this asset to its article definition (model, brand, specifications).Foreign key reference to the
ubicaciones table. Specifies where this asset is physically located.Current operational status of the asset. Uses the
EstadoActivo enum.Possible values:operativo- Asset is operationalmantenimiento- Asset is under maintenancefuera_servicio- Asset is out of servicebaja- Asset has been decommissioned
Monetary value of the asset. Can be null if value is not specified.
Casts
The model automatically casts the following attributes:Relationships
Belongs To
articulo
Returns the article definition (Articulos model) that this asset is based on.- Type:
BelongsTo - Related Model:
App\Models\Articulos - Foreign Key:
articulo_id
ubicacion
Returns the location (Ubicacion model) where this asset is physically located.- Type:
BelongsTo - Related Model:
App\Models\Ubicacion - Foreign Key:
ubicacion_id
Has Many
calendarioMantenimientos
Returns all scheduled maintenance entries for this asset.- Type:
HasMany - Related Model:
App\Models\CalendarioMantenimiento - Foreign Key:
activo_id
mantenimientos
Returns all maintenance records associated with this asset.- Type:
HasMany - Related Model:
App\Models\Mantenimiento - Foreign Key:
activo_id
reportes
Returns all reports filed for this asset.- Type:
HasMany - Related Model:
App\Models\Reporte - Foreign Key:
activo_id
Usage Examples
Creating a New Asset
Updating Asset State
Querying Assets with Relationships
Accessing Nested Relationships
Database Schema
Related Models
- Mantenimiento - Maintenance records for assets
- Reporte - Issue reports for assets
- User - Users who interact with assets
Related Enums
- EstadoActivo - Asset state enum