Corpen automatically records every meaningful user action in a central audit log stored in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/corpentunida-org/corpen/llms.txt
Use this file to discover all available pages before exploring further.
Auditoria table. Each time a controller performs a create, update, or delete operation it calls AuditoriaController@create, which writes a timestamped entry that identifies the acting user, the action description, and the module (area) where it occurred. Administrators can review this log in full at /admin to support compliance requirements and troubleshoot unexpected changes.
Route
The audit log is exposed as a resource controller registered at the rootadmin path:
| Method | URI | Controller Action | Route Name |
|---|---|---|---|
| GET | /admin | AuditoriaController@index | admin.auditoria.index |
auth middleware and the candirect:admin.auditoria.index gate, so only users with the admin.auditoria.index permission can access it.
Database Table: Auditoria
The audit log is persisted in the Auditoria table (note the capital A — this is the value set on the $table property of the auditoria model). The table has no Laravel timestamps columns; all time data is stored in the dedicated fields below.
| Column | Type | Description |
|---|---|---|
id | bigint (auto-increment) | Primary key |
fechaRegistro | date | Calendar date when the action was recorded |
horaRegistro | time | Clock time when the action was recorded |
usuario | string | Display name of the authenticated user (Auth::user()->name) |
accion | string | Free-text description of what was done (e.g., "add usuario app maria.lopez") |
The
usuario_id and area fields are written by AuditoriaController@create at the application layer but are not defined in the 2024_08_02_211212_create_auditorias_table migration. If your database was created solely from migrations those columns will not exist. Ensure your schema is up to date with the codebase before relying on those fields for queries.How Audit Entries Are Created
Every controller that needs to record an audit event instantiatesAuditoriaController via the service container and calls its create method:
create method itself uses Carbon::now() to capture the current date and time, and reads the user identity from Auth::user():
$area parameter is accepted by the method signature (controllers pass values such as "ADMINISTRACIÓN" or "CREDITOS") but the column is not part of the base migration schema — see the note in the Database Table section above.
This pattern is used consistently across admin, credits, portfolio, and other modules — the area argument differentiates which part of the system originated the entry.
Viewing the Audit Log
Navigate to/admin when logged in with the admin.auditoria.index permission. The index action retrieves all records sorted newest-first:
admin.users.usuarios) renders the full list of audit records in reverse chronological order, giving administrators an immediate view of the most recent system activity.
Filtering and Searching Audit Records
The baseindex query returns all records. To narrow results for a specific compliance review, you can query the Auditoria table directly:
- Filter by User
- Filter by Area
- Filter by Date Range
/users/{user}/edit already shows a summary count and the date of the last recorded action for each user, pulled with the same where('usuario', $user->name) pattern.
The
AuditoriaController at App\Http\Controllers\AuditoriaController is the system-wide audit log and is separate from AuditoriaProyectosController (App\Http\Controllers\Flujo\AuditoriaProyectosController). The latter is scoped exclusively to the Flujo/workflows module and records project-level task activity — it exposes its own /auditoria route nested inside the Flujo route group and supports PDF export. Do not confuse the two when reviewing records or configuring permissions.