Agregado UserSeeder para usuario de compras

This commit is contained in:
Alejandro Tasistro 2025-05-08 20:33:03 -03:00
parent b5f37c9de9
commit 31bc076989
2 changed files with 32 additions and 0 deletions

View file

@ -14,5 +14,6 @@ class DatabaseSeeder extends Seeder
{
$this->call(CanastaSeeder::class);
$this->call(GrupoDeCompraSeeder::class);
$this->call(UserSeeder::class);
}
}

View file

@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
class UserSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$usersToInsert = [];
$usersToInsert[] = [
'name' => 'compras',
'password' => Hash::make("123"),
'is_admin' => 0,
'is_compras' => 1
];
foreach (array_chunk($usersToInsert,DatabaseSeeder::CHUNK_SIZE) as $chunk)
{
DB::table('users')->insert($chunk);
}
}
}