feature/modelos-y-migraciones #3

Merged
rho merged 28 commits from feature/modelos-y-migraciones into master 2024-03-14 16:34:44 -03:00
2 changed files with 30 additions and 6 deletions
Showing only changes of commit 2f29b1c34c - Show all commits

View File

@ -0,0 +1,27 @@
<?php
namespace Database\Seeders;
use Illuminate\Support\Facades\Date;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class BarrioSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
DB::table('regiones')->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()],
]);
}
}

View File

@ -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,
]);
}
}