Carga inicial
This commit is contained in:
247
database/seeds/UsersTableSeeder.php
Normal file
247
database/seeds/UsersTableSeeder.php
Normal file
@@ -0,0 +1,247 @@
|
||||
<?php
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class UsersTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
|
||||
/*$atencion =
|
||||
[
|
||||
'email' => 'atencionclientes@mail.com',
|
||||
'password' => bcrypt('secret'),
|
||||
'nombre' => 'Atención',
|
||||
'apellido_materno' => 'Clientes',
|
||||
'apellido_paterno'=> 'Clientes',
|
||||
'telefono' => '6677889900',
|
||||
'tipo_empleado_id' => 5,
|
||||
'sucursal_id' => 1,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
];
|
||||
|
||||
$user_atencion = \App\Models\User::create($atencion);
|
||||
|
||||
\App\Models\RolUser::create([
|
||||
'user_id' => $user_atencion->id,
|
||||
'role_id' => 1,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
]);*/
|
||||
|
||||
$admin =
|
||||
[
|
||||
'email' => 'administrador@mail.com',
|
||||
'password' => bcrypt('secret'),
|
||||
'nombre' => 'Administrador',
|
||||
'apellido_materno' => 'Administrador',
|
||||
'apellido_paterno'=> 'Administrador',
|
||||
'telefono' => '6677889900',
|
||||
'tipo_empleado_id' => 1,
|
||||
'sucursal_id' => 1,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
];
|
||||
|
||||
$user_admin = \App\Models\User::create($admin);
|
||||
|
||||
\App\Models\RolUser::create([
|
||||
'user_id' => $user_admin->id,
|
||||
'role_id' => 2,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
]);
|
||||
|
||||
/*$supervisor =
|
||||
[
|
||||
'email' => 'supervisor@mail.com',
|
||||
'password' => bcrypt('secret'),
|
||||
'nombre' => 'Supervisor',
|
||||
'apellido_materno' => 'Operadores',
|
||||
'apellido_paterno'=> 'Operadores',
|
||||
'telefono' => '6677889900',
|
||||
'tipo_empleado_id' => 1,
|
||||
'sucursal_id' => 1,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
];
|
||||
|
||||
$user_super = \App\Models\User::create($supervisor);
|
||||
|
||||
\App\Models\RolUser::create([
|
||||
'user_id' => $user_super->id,
|
||||
'role_id' => 3,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
]);
|
||||
|
||||
$operador =
|
||||
[
|
||||
'email' => 'operador@mail.com',
|
||||
'password' => bcrypt('secret'),
|
||||
'nombre' => 'Operador',
|
||||
'apellido_materno' => 'Operador',
|
||||
'apellido_paterno'=> 'Operador',
|
||||
'telefono' => '6677889900',
|
||||
'tipo_empleado_id' => 2,
|
||||
'sucursal_id' => 1,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
];
|
||||
|
||||
$user_operador = \App\Models\User::create($operador);
|
||||
|
||||
\App\Models\RolUser::create([
|
||||
'user_id' => $user_operador->id,
|
||||
'role_id' => 4,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
]);
|
||||
|
||||
$gerente =
|
||||
[
|
||||
'email' => 'gerente@mail.com',
|
||||
'password' => bcrypt('secret'),
|
||||
'nombre' => 'Gerente',
|
||||
'apellido_materno' => 'Gerente',
|
||||
'apellido_paterno'=> 'Gerente',
|
||||
'telefono' => '6677889900',
|
||||
'tipo_empleado_id' => 1,
|
||||
'sucursal_id' => 1,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
];
|
||||
|
||||
$user_gerente = \App\Models\User::create($gerente);
|
||||
|
||||
\App\Models\RolUser::create([
|
||||
'user_id' => $user_gerente->id,
|
||||
'role_id' => 5,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
]);
|
||||
|
||||
$auxiliar1 =
|
||||
[
|
||||
'email' => 'auxiliar1@mail.com',
|
||||
'password' => bcrypt('secret'),
|
||||
'nombre' => 'Auxiliar 1',
|
||||
'apellido_materno' => 'Auxiliar',
|
||||
'apellido_paterno'=> 'Auxiliar',
|
||||
'telefono' => '6677889900',
|
||||
'tipo_empleado_id' => 3,
|
||||
'sucursal_id' => 1,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
];
|
||||
|
||||
$user_auxiliar_1 = \App\Models\User::create($auxiliar1);
|
||||
|
||||
\App\Models\RolUser::create([
|
||||
'user_id' => $user_auxiliar_1->id,
|
||||
'role_id' => 6,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
]);
|
||||
|
||||
$auxiliar2 =
|
||||
[
|
||||
'email' => 'auxiliar2@mail.com',
|
||||
'password' => bcrypt('secret'),
|
||||
'nombre' => 'Auxiliar 2',
|
||||
'apellido_materno' => 'Auxiliar',
|
||||
'apellido_paterno'=> 'Auxiliar',
|
||||
'telefono' => '6677889900',
|
||||
'tipo_empleado_id' => 4,
|
||||
'sucursal_id' => 1,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
];
|
||||
|
||||
$user_auxiliar_2 = \App\Models\User::create($auxiliar2);
|
||||
|
||||
\App\Models\RolUser::create([
|
||||
'user_id' => $user_auxiliar_2->id,
|
||||
'role_id' => 6,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
]);
|
||||
|
||||
$auxiliar3 =
|
||||
[
|
||||
'email' => 'auxiliar3@mail.com',
|
||||
'password' => bcrypt('secret'),
|
||||
'nombre' => 'Auxiliar 3',
|
||||
'apellido_materno' => 'Auxiliar',
|
||||
'apellido_paterno'=> 'Auxiliar',
|
||||
'telefono' => '6677889900',
|
||||
'tipo_empleado_id' => 3,
|
||||
'sucursal_id' => 1,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
];
|
||||
|
||||
$user_auxiliar_3 = \App\Models\User::create($auxiliar3);
|
||||
|
||||
\App\Models\RolUser::create([
|
||||
'user_id' => $user_auxiliar_3->id,
|
||||
'role_id' => 6,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
]);
|
||||
|
||||
$auxiliar4 =
|
||||
[
|
||||
'email' => 'auxiliar4@mail.com',
|
||||
'password' => bcrypt('secret'),
|
||||
'nombre' => 'Auxiliar 4',
|
||||
'apellido_materno' => 'Auxiliar',
|
||||
'apellido_paterno'=> 'Auxiliar',
|
||||
'telefono' => '6677889900',
|
||||
'tipo_empleado_id' => 4,
|
||||
'sucursal_id' => 1,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
];
|
||||
|
||||
$user_auxiliar_4 = \App\Models\User::create($auxiliar4);
|
||||
|
||||
\App\Models\RolUser::create([
|
||||
'user_id' => $user_auxiliar_4->id,
|
||||
'role_id' => 6,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
]);
|
||||
|
||||
$operador =
|
||||
[
|
||||
'email' => 'operador2@mail.com',
|
||||
'password' => bcrypt('secret'),
|
||||
'nombre' => 'Operador2',
|
||||
'apellido_materno' => 'Operador2',
|
||||
'apellido_paterno'=> 'Operador2',
|
||||
'telefono' => '6677889900',
|
||||
'tipo_empleado_id' => 2,
|
||||
'sucursal_id' => 2,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
];
|
||||
|
||||
$user_operador = \App\Models\User::create($operador);
|
||||
|
||||
\App\Models\RolUser::create([
|
||||
'user_id' => $user_operador->id,
|
||||
'role_id' => 4,
|
||||
'created_at' => Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||
]);*/
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user