Compare commits
No commits in common. "2add96ecb0b106dba662bba0d1fdffb007f0b772" and "206d06b8bc2f4bf3f3412682112832f85175a8d4" have entirely different histories.
2add96ecb0
...
206d06b8bc
3 changed files with 28 additions and 36 deletions
|
@ -1,35 +0,0 @@
|
||||||
<?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,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
27
database/seeders/BarrioSeeder.php
Normal file
27
database/seeders/BarrioSeeder.php
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
<?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;
|
||||||
|
|
||||||
|
class BarrioSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
$prueba_id = Region::create([
|
||||||
|
'name' => 'PRUEBA',
|
||||||
|
])->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,
|
||||||
BarrioPruebaSeeder::class,
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue