Agregada creacion de bono barrial para barrio prueba en barrioSeeder
This commit is contained in:
parent
206d06b8bc
commit
df5aa07200
2 changed files with 15 additions and 7 deletions
|
@ -8,6 +8,8 @@ use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
use App\Models\Region;
|
use App\Models\Region;
|
||||||
use App\Models\Barrio;
|
use App\Models\Barrio;
|
||||||
|
use App\Models\Producto;
|
||||||
|
use App\Models\Categoria;
|
||||||
|
|
||||||
class BarrioSeeder extends Seeder
|
class BarrioSeeder extends Seeder
|
||||||
{
|
{
|
||||||
|
@ -16,12 +18,18 @@ class BarrioSeeder extends Seeder
|
||||||
*/
|
*/
|
||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
$prueba_id = Region::create([
|
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',
|
'name'=>'PRUEBA',
|
||||||
])->id;
|
'region_id' => Region::create(['name' => 'PRUEBA'])->id
|
||||||
|
])->id,
|
||||||
Barrio::create([
|
|
||||||
'name'=>'PRUEBA','region_id' => $prueba_id
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,9 +15,9 @@ class DatabaseSeeder extends Seeder
|
||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
$this->call([
|
$this->call([
|
||||||
BarrioSeeder::class,
|
|
||||||
CaracteristicaSeeder::class,
|
CaracteristicaSeeder::class,
|
||||||
CanastaSeeder::class,
|
CanastaSeeder::class,
|
||||||
|
BarrioSeeder::class,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue