The Visits module provides Corpen staff with a lightweight, dedicated area for logging and reviewing in-person visits by cooperative members and clients. Staff can search for a member by name or ID using an AJAX endpoint before registering a visit, and all visit records are accessible through both a paginated dashboard and a full CRUD resource.Documentation 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.
Route Group
All routes are grouped under/visitas and protected by the auth middleware. Named routes use the visitas. prefix.
Routes Reference
| Method | URL | Name | Description |
|---|---|---|---|
GET | /visitas/cliente/buscar | visitas.cliente.buscar | AJAX client search for autocomplete |
GET | /visitas/tablero | visitas.tablero | Paginated visit dashboard |
GET | /visitas/corpen | visitas.corpen.index | Full list of visit records |
GET | /visitas/corpen/create | visitas.corpen.create | New visit form |
POST | /visitas/corpen | visitas.corpen.store | Save new visit |
GET | /visitas/corpen/{visitaCorpen} | visitas.corpen.show | View single visit (JSON) |
GET | /visitas/corpen/{visitaCorpen}/edit | visitas.corpen.edit | Edit visit form |
PUT | /visitas/corpen/{visitaCorpen} | visitas.corpen.update | Update visit |
DELETE | /visitas/corpen/{visitaCorpen} | visitas.corpen.destroy | Delete visit |
Controller: VisitaCorpenController
Namespace: App\Http\Controllers\Vistas\VisitaCorpenController
The controller uses the VisitaCorpen model (namespace App\Models\Vistas\VisitaCorpen) and the MaeTerceros model for the client search.
Dashboard (index)
GET /visitas/tablero loads all visits with their associated client, sorted by fecha descending, and paginates at 15 records per page.
Optional query parameters for filtering:
| Parameter | Column | Notes |
|---|---|---|
ciudad | banco | The underlying DB column is banco; the UI label is ciudad |
fecha | fecha | Filters to an exact date (whereDate) |
Client Search (buscarCliente)
GET /visitas/cliente/buscar accepts a query parameter and performs a case-insensitive search on both cod_ter (member ID) and nom_ter (name) in mae_terceros, returning up to 10 results.
Creating a Visit
Search for the member
Before opening the create form, staff can look up the client via the AJAX endpoint. Provide at least a partial name or member ID in the The response supplies the
query parameter:cod_ter (member ID) needed for the visit record.Open the new visit form
Navigate to
GET /visitas/corpen/create. Use the client data returned from the search to populate the member identification field.Submit the visit record
Post to The model’s static A successful store returns a
POST /visitas/corpen. Required and optional fields validated by store():registrar() method is called internally:201 JSON response with the newly created visit.Updating a Visit
Submit aPUT request to /visitas/corpen/{visitaCorpen}. Only the fields banco (city), motivo, and registrado_por are accepted for update:
The client search autocomplete endpoint (
GET /visitas/cliente/buscar?query=...) is the primary entry point for staff to identify members before logging a visit. It queries mae_terceros — the shared member master table — using a LIKE search on both cod_ter and nom_ter, so partial names and partial IDs both work. Results are limited to 10 records to keep the response fast.