pedi3/database/seeders/BonoBarrialSeeder.php

35 lines
855 B
PHP

<?php
namespace Database\Seeders;
use Illuminate\Support\Facades\Date;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use App\Models\Region;
use App\Models\Barrio;
use App\Models\Producto;
use App\Models\Categoria;
class BonoBarrialSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
Producto::create([
'nombre' => 'Bono barrial',
'precio' => 20,
'solidario' => false,
'bono' => true,
'categoria_id' => Categoria::firstOrCreate([
'nombre' => 'TRANSPORTE, BONOS Y FINANCIAMIENTO SORORO'
])->id,
'barrio_id' => Barrio::firstOrCreate([
'nombre'=>'PRUEBA'
])->id,
]);
}
}