When a user deletes a supported record in Leo Counter — an account, a category, a pending movement, or a budget — the record is not immediately removed from the database. Instead, Laravel’s soft-delete mechanism stamps aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/juanVillamilEchavarria/Leo_Counter-app/llms.txt
Use this file to discover all available pages before exploring further.
deleted_at timestamp on the row and filters it out of all regular queries. The data remains intact and fully recoverable until an admin decides to permanently erase it. This design prevents accidental loss of financial history and gives administrators a safety net before data is gone for good.
The soft-delete management panel is exclusively accessible to administrators. All routes under
/configuracion/deleted/* are wrapped in AdminMiddleware, which aborts with HTTP 403 if the authenticated user’s role is not admin.Supported Domains
Leo Counter’sSoftDeleteManagerTypes enum defines the four domains that participate in soft deletion:
| Domain slug | Label | Table | Migration |
|---|---|---|---|
cuentas | Cuentas | cuentas | 2026_02_08_215547_add_sof_deletes_to_cuentas_table.php |
categorias | Categorias | categorias | 2026_01_14_200821_create_categorias_table.php |
movimientosPendientes | Movimientos Pendientes | movimiento_pendientes | 2026_01_27_190641_create_movimiento_pendientes_table.php |
presupuestos | Presupuestos | presupuestos | 2026_01_21_225025_create_presupuestos_table.php |
cuentas table received its deleted_at column via a dedicated additive migration (the original create_cuentas_table migration also dropped the legacy archived boolean column at the same time). The remaining three tables had softDeletes() included in their creation migrations from the start.
Routes
All three soft-delete actions share the same URL pattern, using{domain} as the slug from the table above.
| Method | Path | Route name | Description |
|---|---|---|---|
GET | /configuracion/deleted/{domain} | configuracion.deleted.index | List all soft-deleted records for a domain |
PUT | /configuracion/deleted/{domain}/restore/{id} | configuracion.deleted.restore | Restore a single soft-deleted record |
DELETE | /configuracion/deleted/{domain}/hard-delete/{id} | configuracion.deleted.hardDelete | Permanently remove a record from the database |
Example URLs
How It Works
TheSoftDeleteRecordsController resolves the correct domain type from the URL slug and delegates to CQRS command/query handlers:
SoftDeleteManagerTypes::try() to throw a LogicException, so only the four valid slugs are accepted.
Viewing Soft-Deleted Records
Open the Configuration panel
Navigate to
/configuracion (requires admin role). The configuration index lists available management sections.Select a domain
Go to the appropriate deleted-records URL, for example
/configuracion/deleted/cuentas. The page renders a list of all records whose deleted_at is not null, presented through a domain-specific Inertia view.Restoring a Record
Submitting aPUT request to /configuracion/deleted/{domain}/restore/{id} dispatches RestoreRecordCommand. The handler clears the deleted_at timestamp on the matching row, making the record visible again in all regular application queries.
- Cuentas
- Categorias
- Movimientos Pendientes
- Presupuestos
Restoring a soft-deleted account makes it appear again in
/cuentas and become selectable when recording movements.Permanently Deleting a Record
Submitting aDELETE request to /configuracion/deleted/{domain}/hard-delete/{id} dispatches HardDeleteRecordCommand. The handler executes a true SQL DELETE against the row, bypassing Laravel’s soft-delete filter entirely. The record and all data it contains are removed from the database permanently.
Inertia Views by Domain
The controller selects the correct React page component based on the resolved domain type:| Domain | Inertia View |
|---|---|
cuentas | Configuracion/Deleted/Cuentas |
categorias | Configuracion/Deleted/Categorias |
movimientosPendientes | Configuracion/Deleted/MovimientosPendientes |
presupuestos | Configuracion/Deleted/Presupuestos |
data prop containing the domain’s deleted records (transformed through a DeletedRecordsResourceResolver) and a title prop such as "Cuentas Eliminados".