Mega Creative includes a full set of database seeders that populate every table with realistic sample data using the Faker library. Running the seeder after migration gives you a fully functional application instance with 100 students, 10 academic programs, and a complete set of geographic and lookup data — no manual data entry required.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.
Running the Seeder
Ensure migrations have already run
The seeders insert rows into tables that must already exist. If you have not yet run migrations, do so first:
What Gets Seeded
| Seeder Class | Method | Output |
|---|---|---|
StatusesTableSeeder | Manual DB::insert | 2 rows — Habilitado, Inhabilitado |
SexosTableSeeder | Manual DB::insert | 2 rows — Masculino, Femenino |
CarrerasTableSeeder | Faker factory | 10 academic programs with a unique color-based name, a short sentence description, and a random status |
PaisesTableSeeder | Faker factory | 30 countries with unique Faker-generated country names |
EstadosTableSeeder | Faker factory | 50 states / provinces with unique Faker-generated names |
CiudadesTableSeeder | Faker factory | 50 cities with unique Faker-generated names |
EstudiantesTableSeeder | Faker factory | 100 students with realistic names, a unique email, a random birth date between 20 and 40 years ago, and valid FK references to the rows created above |
The Faker-generated geographic data — countries, states, and cities — contains placeholder names drawn from Faker’s built-in locale data. These names are not structured as real geographic hierarchies (a city is not associated with a specific state or country). For a production deployment you should replace the
PaisesTableSeeder, EstadosTableSeeder, and CiudadesTableSeeder with curated real-world data and add the appropriate relational links between them.Seeder Order
TheDatabaseSeeder class is the single entry point that Artisan calls. It invokes each seeder class in a specific order that respects foreign key dependencies — for example, StatusesTableSeeder must run before CarrerasTableSeeder because each carrera holds a status_id FK. Below is the complete DatabaseSeeder::run() method as defined in the source:
statusesmust exist beforecarrerasandestudiantes(both holdstatus_id).sexosmust exist beforeestudiantes(sexo_id).carrerasmust exist beforeestudiantes(carrera_id).paises,estados, andciudadesmust all exist beforeestudiantes(pais_id,estado_id,ciudad_id).
EstudiantesTableSeeder is therefore always last.
Individual Seeders
You can run a single seeder class without invoking the fullDatabaseSeeder. This is useful when you want to top up one table without touching the others:
When running individual seeders, you are responsible for ensuring that any tables they depend on are already populated. Running
EstudiantesTableSeeder on an empty database will fail with a foreign key constraint violation because the factory assigns random IDs from the ranges 1–2 (statuses, sexos), 1–10 (carreras), 1–30 (paises), and 1–50 (estados, ciudades).