Laravel 11, Vuexy Admin 10.3, by admin@koneko.mx
This commit is contained in:
16
modules/Admin/Database/seeders/AdminDatabaseSeeder.php
Normal file
16
modules/Admin/Database/seeders/AdminDatabaseSeeder.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Database\seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class AdminDatabaseSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$this->call(RoleSeeder::class);
|
||||
$this->call(UserSeeder::class);
|
||||
$this->call(SettingSeeder::class);
|
||||
$this->call(SATCatalogsSeeder::class);
|
||||
}
|
||||
}
|
1272
modules/Admin/Database/seeders/RoleSeeder.php
Normal file
1272
modules/Admin/Database/seeders/RoleSeeder.php
Normal file
File diff suppressed because it is too large
Load Diff
83
modules/Admin/Database/seeders/SATCatalogsSeeder.php
Normal file
83
modules/Admin/Database/seeders/SATCatalogsSeeder.php
Normal file
@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Database\seeders;
|
||||
|
||||
use Modules\Admin\App\Imports\SatCatalogsImport;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Modules\Admin\App\Models\Sat\Banco;
|
||||
|
||||
class SATCatalogsSeeder extends Seeder
|
||||
{
|
||||
protected $console;
|
||||
|
||||
public function __construct($console = null)
|
||||
{
|
||||
$this->console = $console;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$this->importCatCFDIV4(base_path("modules/Admin/Database/data/catCFDI_V_4_20241121.xls"));
|
||||
$this->importCatBancos(base_path('modules/Admin/Database/data/catalog-sat_bancos.json'));
|
||||
}
|
||||
|
||||
private function importCatCFDIV4($file_path)
|
||||
{
|
||||
$import = new SatCatalogsImport($this->console);
|
||||
|
||||
$sheets = [
|
||||
'c_FormaPago',
|
||||
'c_Moneda',
|
||||
'c_CodigoPostal_Parte_1',
|
||||
'c_CodigoPostal_Parte_2',
|
||||
'c_RegimenFiscal',
|
||||
'c_Pais',
|
||||
'c_UsoCFDI',
|
||||
'C_Colonia_1',
|
||||
'C_Colonia_2',
|
||||
'C_Colonia_3',
|
||||
'c_Estado',
|
||||
'C_Localidad',
|
||||
'C_Municipio',
|
||||
];
|
||||
|
||||
$this->command->getOutput()->progressStart(count($sheets));
|
||||
|
||||
foreach ($sheets as $sheet) {
|
||||
$import = new SatCatalogsImport();
|
||||
$import->onlySheets($sheet);
|
||||
|
||||
Excel::import($import, $file_path);
|
||||
|
||||
$this->command->getOutput()->progressAdvance();
|
||||
}
|
||||
|
||||
$this->command->getOutput()->progressFinish();
|
||||
}
|
||||
|
||||
private function importCatBancos($file_path)
|
||||
{
|
||||
$json = File::get($file_path);
|
||||
|
||||
// Convierte el contenido JSON a un array asociativo
|
||||
$bancos = json_decode($json, true);
|
||||
|
||||
// Inserta cada banco en la base de datos
|
||||
foreach ($bancos as $banco) {
|
||||
Banco::create([
|
||||
'c_banco' => $banco['c_banco'],
|
||||
'descripcion' => $banco['descripcion'],
|
||||
'razon_social' => $banco['razon_social'],
|
||||
'rfc' => null,
|
||||
'status' => Banco::STATUS_ENABLED,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
108
modules/Admin/Database/seeders/SettingSeeder.php
Normal file
108
modules/Admin/Database/seeders/SettingSeeder.php
Normal file
@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Database\seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
use Modules\Admin\App\Models\Setting;
|
||||
|
||||
class SettingSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$settings_array = [
|
||||
/*
|
||||
'app_title' => 'Quimiplastic S.A de C.V.',
|
||||
'app_faviconIcon' => '../assets/img/logo/koneko-02.png',
|
||||
'app_name' => 'Quimiplastic',
|
||||
'app_imageLogo' => '../assets/img/logo/koneko-02.png',
|
||||
|
||||
'app_myLayout' => 'vertical',
|
||||
'app_myTheme' => 'theme-default',
|
||||
'app_myStyle' => 'light',
|
||||
'app_navbarType' => 'sticky',
|
||||
'app_menuFixed' => true,
|
||||
'app_menuCollapsed' => false,
|
||||
'app_headerType' => 'static',
|
||||
'app_showDropdownOnHover' => false,
|
||||
'app_authViewMode' => 'cover',
|
||||
'app_maxQuickLinks' => 5,
|
||||
|
||||
|
||||
|
||||
'smtp.host' => 'webmail.koneko.mx',
|
||||
'smtp.port' => 465,
|
||||
'smtp.encryption' => 'tls',
|
||||
'smtp.username' => 'no-responder@koneko.mx',
|
||||
'smtp.password' => null,
|
||||
'smtp.from_email' => 'no-responder@koneko.mx',
|
||||
'smtp.from_name' => 'Koneko Soluciones en Tecnología',
|
||||
'smtp.reply_to_method' => 'smtp',
|
||||
'smtp.reply_to_email' => null,
|
||||
'smtp.reply_to_name' => null,
|
||||
|
||||
|
||||
|
||||
'website.title',
|
||||
'website.favicon',
|
||||
'website.description',
|
||||
'website.image_logo',
|
||||
'website.image_logoDark',
|
||||
|
||||
'admin.title',
|
||||
'admin.favicon',
|
||||
'admin.description',
|
||||
'admin.image_logo',
|
||||
'admin.image_logoDark',
|
||||
|
||||
|
||||
'favicon.icon' => null,
|
||||
|
||||
'contact.phone_number' => '(222) 462 0903',
|
||||
'contact.phone_number_ext' => 'Ext. 5',
|
||||
'contact.email' => 'virtualcompras@live.com.mx',
|
||||
'contact.form.email' => 'contacto@conciergetravellife.com',
|
||||
'contact.form.email_cc' => 'arturo@koneko.mx',
|
||||
'contact.form.subject' => 'Has recibido un mensaje del formulario de covirsast.com',
|
||||
'contact.direccion' => '51 PTE 505 loc. 14, Puebla, Pue.',
|
||||
'contact.horario' => '9am - 7 pm',
|
||||
'contact.location.lat' => '19.024439',
|
||||
'contact.location.lng' => '-98.215777',
|
||||
|
||||
'social.whatsapp' => '',
|
||||
'social.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! 💻✨',
|
||||
|
||||
'social.facebook' => 'https://www.facebook.com/covirsast/?locale=es_LA',
|
||||
'social.Whatsapp' => '2228 200 201',
|
||||
'social.Whatsapp.message' => '¡Hola! 🌟 Estoy interesado en obtener más información acerca de Concierge Travel. ¿Podrías ayudarme con los detalles? ¡Gracias de antemano! ✈️🏝',
|
||||
'social.Facebook' => 'test',
|
||||
'social.Instagram' => 'test',
|
||||
'social.Linkedin' => 'test',
|
||||
'social.Tiktok' => 'test',
|
||||
'social.X_twitter' => 'test',
|
||||
'social.Google' => 'test',
|
||||
'social.Pinterest' => 'test',
|
||||
'social.Youtube' => 'test',
|
||||
'social.Vimeo' => 'test',
|
||||
|
||||
|
||||
'chat.provider' => '',
|
||||
'chat.whatsapp.number' => '',
|
||||
'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([
|
||||
'key' => $key,
|
||||
'value' => $value,
|
||||
]);
|
||||
};
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user