diff --git a/database/seeders/BarrioSeeder.php b/database/seeders/BarrioSeeder.php new file mode 100644 index 0000000..595f278 --- /dev/null +++ b/database/seeders/BarrioSeeder.php @@ -0,0 +1,27 @@ +insert([ + ['name'=>'PRUEBA', 'created_at'=>Date::now()] + ]); + + $prueba_id = DB::table('regiones')->where('name','PRUEBA')->first()->id; + + DB::table('barrios')->insert([ + ['name'=>'PRUEBA','region_id'=>$prueba_id, 'created_at'=>Date::now()], + ]); + } +} diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index a9f4519..9e2405c 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -12,11 +12,8 @@ class DatabaseSeeder extends Seeder */ public function run(): void { - // \App\Models\User::factory(10)->create(); - - // \App\Models\User::factory()->create([ - // 'name' => 'Test User', - // 'email' => 'test@example.com', - // ]); + $this->call([ + BarrioSeeder::class, + ]); } }