Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Seeders
Browse files Browse the repository at this point in the history
  • Loading branch information
rats4final committed Dec 13, 2022
1 parent 6917865 commit 3b046ba
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 6 deletions.
14 changes: 8 additions & 6 deletions database/seeders/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace Database\Seeders;

// use Illuminate\Database\Console\Seeds\WithoutModelEvents;

use App\Models\TipoSangre;
use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
Expand All @@ -14,11 +16,11 @@ class DatabaseSeeder extends Seeder
*/
public function run()
{
// \App\Models\User::factory(10)->create();

// \App\Models\User::factory()->create([
// 'name' => 'Test User',
// 'email' => '[email protected]',
// ]);
$this->call([
TipoSangre::class,
SedeSeeder::class,
TipoPatologiaSeeder::class,
EspecialidadSeeder::class
]);
}
}
24 changes: 24 additions & 0 deletions database/seeders/EspecialidadSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace Database\Seeders;

use App\Models\Especialidad;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class EspecialidadSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$datos = [
'nombre_especialidad' => 'Caradiologo',
'descripcion_especialidad' => 'Los cardiólogos son médicos que se especializan en el diagnóstico y tratamiento de las enfermedades del corazón y los vasos sanguíneos'
];
Especialidad::insert($datos);
}
}
29 changes: 29 additions & 0 deletions database/seeders/SedeSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Database\Seeders;

use App\Models\Sede;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class SedeSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$datos = [
[
'nombre_sede' => 'La Paz',
'direccion_sede' => 'Entre Pedro Villamil y Nuñez del Prado',
'telefono_sede' => '2231663',
'ciudad_sede' => 'La Paz',

]
];
Sede::insert($datos);
}
}
27 changes: 27 additions & 0 deletions database/seeders/TipoPatologiaSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Database\Seeders;

use App\Models\TipoPatologia;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class TipoPatologiaSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$datos = [
[
'nombre_patologia' => 'Gastritis',
'desc_patologia' => 'La gastritis es un término general para un grupo de enfermedades con un punto en común: la inflamación del revestimiento del estómago.'
],
];

TipoPatologia::insert($datos);
}
}
45 changes: 45 additions & 0 deletions database/seeders/TipoSangreSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

namespace Database\Seeders;

use App\Models\TipoSangre;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class TipoSangreSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$datos = [
[
'nombre_tipo_sangre' => 'O+',
'descripcion_tipo_sangre' => 'Tipo de sangre O positivo',
'rareza_tipo_sangre' => 'Comun'
],
[
'nombre_tipo_sangre' => 'A+',
'descripcion_tipo_sangre' => 'Tipo de sangre A positivo',
'rareza_tipo_sangre' => 'Comun'
],
[
'nombre_tipo_sangre' => 'O-',
'descripcion_tipo_sangre' => 'Tipo de Sangre O negativo',
'rareza_tipo_sangre' => 'Rara'
],
[
'nombre_tipo_sangre' => 'AB-',
'descripcion_tipo_sangre' => 'Tipo de sangre AB negativo',
'rareza_tipo_sangre' => 'Escaza'
],

];
TipoSangre::insert($datos);


}
}

0 comments on commit 3b046ba

Please sign in to comment.