36 lines
916 B
PHP
36 lines
916 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 BarrioPruebaSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
Producto::create([
|
|
'name' => 'Bono barrial',
|
|
'price' => 20,
|
|
'solidario' => false,
|
|
'bono' => true,
|
|
'categoria_id' => Categoria::firstOrCreate([
|
|
'name' => 'TRANSPORTE, BONOS Y FINANCIAMIENTO SORORO'
|
|
])->id,
|
|
'barrio_id' => Barrio::create([
|
|
'name'=>'PRUEBA',
|
|
'region_id' => Region::create(['name' => 'PRUEBA'])->id
|
|
])->id,
|
|
]);
|
|
}
|
|
}
|