The Students (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/keving5726/megacreative/llms.txt
Use this file to discover all available pages before exploring further.
Estudiantes) module is the core of Mega Creative. Every student record stores personal information, enrollment data, and geographic location — all linked to shared lookup tables via foreign keys. The module is backed by a full resourceful controller (EstudianteController) that handles listing, creating, showing, editing, updating, and deleting records.
Student Fields
Theestudiantes table is defined in 2019_09_09_171016_create_estudiantes_table.php. Every column below is required; none accept null values.
| Field | Type | Description |
|---|---|---|
nombres | string, max 100 | Student’s first name(s) |
apellidos | string, max 100 | Student’s last name(s) |
sexo_id | FK → sexos | Sex — Masculino or Femenino |
fecha_de_nacimiento | date | Date of birth |
email | string, max 100, unique | Email address (must be unique across all records) |
carrera_id | FK → carreras | Enrolled academic program |
status_id | FK → statuses | Enrollment status — Habilitado or Inhabilitado |
pais_id | FK → paises | Country of residence |
estado_id | FK → estados | State or province of residence |
ciudad_id | FK → ciudades | City of residence |
The
email column has a UNIQUE constraint enforced at the database level
($table->unique('email')). Attempting to save a duplicate email will raise a
database integrity exception even if server-side validation passes.Routes
Bothestudiantes and carreras are registered together using Laravel’s Route::resources() helper in routes/web.php, which generates the full set of RESTful routes automatically.
| Method | Path | Controller Method | Purpose |
|---|---|---|---|
GET | /estudiantes | index | List all student records |
GET | /estudiantes/create | create | Display the create form |
POST | /estudiantes | store | Persist a new student record |
GET | /estudiantes/{id} | show | Display a single student detail |
GET | /estudiantes/{id}/edit | edit | Display the edit form |
PUT/PATCH | /estudiantes/{id} | update | Update an existing student record |
DELETE | /estudiantes/{id} | destroy | Delete a student record |
Validation Rules
Bothstore() and update() run the same validation rules via $request->validate(). All ten fields are required; nombres, apellidos, and email are additionally capped at their respective max lengths.
Creating a Student
Navigate to the create form
Go to All six variables are passed to
GET /estudiantes/create. The EstudianteController@create method
fetches all six lookup collections before rendering the view:estudiantes.create via compact().Fill in the text fields
Enter the student’s Nombres (first names) and Apellidos (last names),
each capped at 100 characters. Provide a valid Email address — it must be
unique across the whole system. Pick a Fecha de Nacimiento using the date
picker.
Choose from the dropdowns
Four dropdown selects are populated from lookup tables:
- Sexo — rendered from
$sexos, displays thetipocolumn (Masculino/Femenino), posts the recordid. - Carrera — rendered from
$carreras, displays thenombrecolumn. - Status — rendered from
$statuses, displays thestatuscolumn (Habilitado/Inhabilitado). - Pais / Estado / Ciudad — three chained geographic dropdowns rendered from
$paises,$estados, and$ciudadesrespectively, each displaying thenombrecolumn.
Relationships
TheEstudiante model declares six hasOne relationships — one for every foreign key column. Each resolves the associated lookup record by matching the local *_id column to the primary key of the related table.