Agregada creacion de bono barrial para barrio prueba en barrioSeeder

This commit is contained in:
Alejandro Tasistro 2024-03-14 23:14:11 -03:00
parent 206d06b8bc
commit df5aa07200
2 changed files with 15 additions and 7 deletions

View File

@ -8,6 +8,8 @@
use Illuminate\Database\Seeder;
use App\Models\Region;
use App\Models\Barrio;
use App\Models\Producto;
use App\Models\Categoria;
class BarrioSeeder extends Seeder
{
@ -16,12 +18,18 @@ class BarrioSeeder extends Seeder
*/
public function run(): void
{
$prueba_id = Region::create([
'name' => 'PRUEBA',
])->id;
Barrio::create([
'name'=>'PRUEBA','region_id' => $prueba_id
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,
]);
}
}

View File

@ -15,9 +15,9 @@ class DatabaseSeeder extends Seeder
public function run(): void
{
$this->call([
BarrioSeeder::class,
CaracteristicaSeeder::class,
CanastaSeeder::class,
BarrioSeeder::class,
]);
}
}