Authentication
All endpoints require:- Middleware:
auth,verified - Role:
admin,doctor, orreceptionist
Endpoints
List Patients
Query Parameters
Search term to filter patients by full name, document ID, phone, or email
Page number for pagination
Response
Returns an Inertia render with:Paginated collection of patient records
Current page number
Items per page (10)
Total number of patients
Active search filters
Create Patient Form
Response
Returns an Inertia render of the patient creation form.Store Patient
Request Body
Validated byStorePatientRequest:
Patient’s full name (max 255 characters)
Identification document number (max 50 characters, must be unique)
Date of birth (format: YYYY-MM-DD)
Gender:
male, female, or otherContact phone number (max 20 characters)
Email address (max 255 characters)
Physical address
Medical history and antecedents
Known allergies
Chronic diseases and conditions
Current medications
Additional notes
Response
Redirects to/patients with success message: “Paciente registrado exitosamente.”
Show Patient
Path Parameters
Patient ID
Response
Patient record with relationships
Patient ID
Patient’s full name
Identification document
Medical history
Known allergies
Array of file attachments
Array of consultation records with doctor information (latest first)
Edit Patient Form
Path Parameters
Patient ID
Response
Returns an Inertia render with the patient data.Update Patient
Path Parameters
Patient ID
Request Body
Validated byUpdatePatientRequest. All fields are optional (use sometimes rule):
Patient’s full name (max 255 characters)
Identification document number (max 50 characters, must be unique)
Date of birth
Gender:
male, female, or otherContact phone number (max 20 characters)
Email address (max 255 characters)
Physical address
Medical history
Known allergies
Chronic diseases
Current medications
Additional notes
Response
Redirects to/patients with success message: “Datos del paciente actualizados.”
Delete Patient
Path Parameters
Patient ID
Authorization
Returns 403 error if the authenticated user does not have theadmin role.
Response
Redirects back with success message: “Paciente eliminado.”Implementation Details
- Source:
app/Http/Controllers/PatientController.php - Search functionality queries:
full_name,document_id,phone,email - Pagination: 10 records per page
- Uses action classes:
CreatePatientAction,UpdatePatientAction - Soft deletes enabled (records marked as deleted but preserved in database)