Compare commits
2 Commits
206d06b8bc
...
2add96ecb0
Author | SHA1 | Date |
---|---|---|
Alejandro Tasistro | 2add96ecb0 | |
Alejandro Tasistro | df5aa07200 |
|
@ -0,0 +1,35 @@
|
|||
<?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,
|
||||
]);
|
||||
}
|
||||
}
|
|
@ -1,27 +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;
|
||||
|
||||
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
|
||||
{
|
||||
$this->call([
|
||||
BarrioSeeder::class,
|
||||
CaracteristicaSeeder::class,
|
||||
CanastaSeeder::class,
|
||||
BarrioPruebaSeeder::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue