miscellaneous updates

This commit is contained in:
2025-01-26 23:14:28 -06:00
parent 493413ec97
commit cff8101088
28 changed files with 734 additions and 474 deletions

View File

@ -10,7 +10,7 @@ class AdminDatabaseSeeder extends Seeder
{
$this->call(RoleSeeder::class);
$this->call(UserSeeder::class);
$this->call(SettingSeeder::class);
//$this->call(SettingSeeder::class);
$this->call(SATCatalogsSeeder::class);
}
}

View File

@ -16,7 +16,6 @@ class SettingSeeder extends Seeder
public function run()
{
$settings_array = [
/*
'app_title' => 'Quimiplastic S.A de C.V.',
'app_faviconIcon' => '../assets/img/logo/koneko-02.png',
'app_name' => 'Quimiplastic',
@ -96,7 +95,7 @@ class SettingSeeder extends Seeder
'chat.whatsapp.message' => '👋 Hola! Estoy buscando más información sobre Covirsa Soluciones en Tecnología. ¿Podrías proporcionarme los detalles que necesito? ¡Te lo agradecería mucho! 💻✨',
'webTpl.container' => 'custom-container',
*/];
];
foreach ($settings_array as $key => $value) {
Setting::create([

View File

@ -0,0 +1,77 @@
<?php
namespace Modules\Admin\Database\seeders;
use Modules\Admin\App\Models\User;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Storage;
use Illuminate\Database\Seeder;
class UserSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
// Define el disco y la carpeta
$disk = 'public';
$directory = 'profile-photos';
// Verifica si la carpeta existe
if (Storage::disk($disk)->exists($directory))
Storage::disk($disk)->deleteDirectory($directory);
// Arturo Corro
$user = User::create([
'name' => 'Koneko Admin',
'email' => 'admin@koneko.mx',
'email_verified_at' => now(),
'password' => bcrypt('LAdmin123'),
'status' => User::STATUS_ENABLED,
])->assignRole('SuperAdmin');
$user->updateProfilePhoto(new UploadedFile(
'public/assets/img/logo/koneko-02.png',
'koneko-02.png'
));
// Webmaster admin
$user = User::create([
'name' => 'Admin',
'email' => 'servers@koneko.mx',
'email_verified_at' => now(),
'password' => bcrypt('LAdmin123'),
'status' => User::STATUS_ENABLED,
])->assignRole('Admin');
$user->updateProfilePhoto(new UploadedFile(
'public/assets/img/logo/koneko-03.png',
'koneko-03.png'
));
// Usuarios CSV
$csvFile = fopen(base_path("modules/Admin/Database/data/users.csv"), "r");
$firstline = true;
while (($data = fgetcsv($csvFile, 2000, ",")) !== FALSE) {
if (!$firstline) {
User::create([
'name' => $data['0'],
'email' => $data['1'],
'email_verified_at' => now(),
'password' => bcrypt($data['3']),
'status' => User::STATUS_ENABLED,
])->assignRole($data['2']);
}
$firstline = false;
}
fclose($csvFile);
}
}