The Programs (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.
Carreras) module manages the catalog of academic programs available for student enrollment. Each program has a unique name, a short description, and an active/inactive status. Programs are lightweight — the carreras table has no timestamp columns — but they are central to the registry because every student must be linked to one program via carrera_id.
Program Fields
Thecarreras table is defined in 2019_09_09_171012_create_carreras_table.php. All three fields are required and validated before a record is saved.
| Field | Type | Description |
|---|---|---|
nombre | string, max 100, unique | Program name — must be unique across all programs |
descripcion | string, max 180 | Short description of the program |
status_id | FK → statuses | Active status — Habilitado or Inhabilitado |
The
carreras table uses tinyIncrements for its primary key and has no
timestamps columns (public $timestamps = false in the model). The nombre
column carries a UNIQUE constraint at the database level.Routes
Programs share theRoute::resources() declaration in routes/web.php alongside students, giving CarreraController a full set of RESTful routes.
| Method | Path | Controller Method | Purpose |
|---|---|---|---|
GET | /carreras | index | List all academic programs |
GET | /carreras/create | create | Display the create form |
POST | /carreras | store | Persist a new program |
GET | /carreras/{id} | show | Display a single program detail |
GET | /carreras/{id}/edit | edit | Display the edit form |
PUT/PATCH | /carreras/{id} | update | Update an existing program |
DELETE | /carreras/{id} | destroy | Delete a program |
Validation Rules
CarreraController@store() and CarreraController@update() both apply the same three rules before writing to the database.
create and edit forms load the full list of statuses so users can select from a dropdown:
Relationship to Students
The cascade is defined in theestudiantes migration:
Carrera model exposes a single Eloquent relationship back to the statuses table: