Se comenzó a programar seeders y modelos (las migraciones ya están terminadas)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class ProfesionSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$profesiones = [
|
||||
['titulo' => 'Abogacía', 'visible_en_formulario' => true],
|
||||
['titulo' => 'Informático', 'visible_en_formulario' => false]
|
||||
];
|
||||
|
||||
foreach ($profesiones as $profesion){
|
||||
DB::table('profesiones')->insert([
|
||||
'titulo'=>$profesion['titulo'],
|
||||
'visible_en_formulario'=>$profesion['visible_en_formulario'],
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user