pedi3/database/seeders/BarrioSeeder.php

28 lines
583 B
PHP
Raw Normal View History

<?php
namespace Database\Seeders;
use Illuminate\Support\Facades\Date;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
2024-03-12 23:56:05 -03:00
use App\Models\Region;
use App\Models\Barrio;
class BarrioSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
2024-03-12 23:56:05 -03:00
$prueba_id = Region::create([
2024-07-03 19:22:42 -03:00
'nombre' => 'PRUEBA',
2024-03-12 23:56:05 -03:00
])->id;
2024-03-12 23:56:05 -03:00
Barrio::create([
2024-07-03 19:22:42 -03:00
'nombre'=>'PRUEBA','region_id'=>$prueba_id, 'created_at'=>Date::now()
]);
}
}