feat: version final de produccion para vueloenglobo.mx

This commit is contained in:
karenzamvega 2026-09-28 22:14:32 -06:00
parent 05b8a41a62
commit 3d460c3919
615 changed files with 51689 additions and 42 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

18
.editorconfig Normal file
View File

@ -0,0 +1,18 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_size = 2
[docker-compose.yml]
indent_size = 4

59
.env.example Normal file
View File

@ -0,0 +1,59 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
MEMCACHED_HOST=127.0.0.1
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1
VITE_APP_NAME="${APP_NAME}"
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

11
.gitattributes vendored Normal file
View File

@ -0,0 +1,11 @@
* text=auto eol=lf
*.blade.php diff=html
*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php
/.github export-ignore
CHANGELOG.md export-ignore
.styleci.yml export-ignore

20
.gitignore vendored Normal file
View File

@ -0,0 +1,20 @@
/.phpunit.cache
/node_modules
/public/build
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.env.production
.phpunit.result.cache
Homestead.json
Homestead.yaml
auth.json
npm-debug.log
yarn-error.log
/.fleet
/.idea
/.vscode
Caddyfile

8
.htaccess Normal file
View File

@ -0,0 +1,8 @@
<IfModule mod_rewrite.c>
RewriteEngine On
# Redirigir todo hacia /public
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

178
LICENSE
View File

@ -6,59 +6,187 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions. 1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. "Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: 4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and (b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. (d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. 9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work. APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2026 alonsojavizz Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -1,2 +1,66 @@
# vueloenglobo.mx <p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
<p align="center">
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
</p>
## About Laravel
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
- [Simple, fast routing engine](https://laravel.com/docs/routing).
- [Powerful dependency injection container](https://laravel.com/docs/container).
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
- [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
Laravel is accessible, powerful, and provides tools required for large, robust applications.
## Learning Laravel
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
## Laravel Sponsors
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).
### Premium Partners
- **[Vehikl](https://vehikl.com/)**
- **[Tighten Co.](https://tighten.co)**
- **[WebReinvent](https://webreinvent.com/)**
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
- **[64 Robots](https://64robots.com)**
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
- **[Cyber-Duck](https://cyber-duck.co.uk)**
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
- **[Jump24](https://jump24.co.uk)**
- **[Redberry](https://redberry.international/laravel/)**
- **[Active Logic](https://activelogic.com)**
- **[byte5](https://byte5.de)**
- **[OP.GG](https://op.gg)**
## Contributing
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
## Code of Conduct
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
## Security Vulnerabilities
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
## License
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

27
app/Console/Kernel.php Normal file
View File

@ -0,0 +1,27 @@
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*/
protected function schedule(Schedule $schedule): void
{
// $schedule->command('inspire')->hourly();
}
/**
* Register the commands for the application.
*/
protected function commands(): void
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
class Handler extends ExceptionHandler
{
/**
* The list of the inputs that are never flashed to the session on validation exceptions.
*
* @var array<int, string>
*/
protected $dontFlash = [
'current_password',
'password',
'password_confirmation',
];
/**
* Register the exception handling callbacks for the application.
*/
public function register(): void
{
$this->reportable(function (Throwable $e) {
//
});
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class AdminDashController extends Controller
{
public function vuelos()
{
return view('admin.vuelos');
}
}

View File

@ -0,0 +1,11 @@
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class ClipApiController extends Controller
{
//
}

View File

@ -0,0 +1,64 @@
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
class GloboERPController extends Controller
{
protected int $sitio_web;
protected int $status;
public function __construct()
{
$this->sitio_web = config('sitioweb.sitio_web_erp_id', 0);
$this->status = 1;
}
public function getNombresImagenGlobosActivos()
{
try {
$baseUrl = 'https://erp.skyballoons.mx/assets/images/globos/';
$globos = DB::table('globos')
->select('nombre_globo', 'ruta_imagen')
->where('estatus_globo', $this->status)
->where('id_estatus', $this->status)
->where('empresa', 'sky')
->get()
->map(function ($globo) use ($baseUrl) {
if (!empty($globo->ruta_imagen)) {
// Si ya es URL completa la dejamos igual
if (!filter_var($globo->ruta_imagen, FILTER_VALIDATE_URL)) {
$archivo = ltrim($globo->ruta_imagen, '/');
$globo->ruta_imagen = $baseUrl . $archivo;
}
}
return $globo;
});
return response()->json([
'success' => true,
'data' => $globos
]);
} catch (\Throwable $e) {
Log::error('Error obteniendo globos activos', [
'message' => $e->getMessage()
]);
return response()->json([
'success' => false,
'message' => 'No se pudieron obtener los globos'
], 500);
}
}
}

View File

@ -0,0 +1,313 @@
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
class TelegramController extends Controller
{
protected string $token;
protected string $baseUrl;
public function __construct()
{
$this->token = env('TELEGRAM_BOT_TOKEN');
$this->baseUrl = "https://api.telegram.org/bot{$this->token}";
}
/*
|--------------------------------------------------------------------------
| WEBHOOK (Telegram -> Laravel)
|--------------------------------------------------------------------------
*/
public function webhook(Request $request)
{
$update = $request->all();
Log::info('Telegram Update', $update);
if (isset($update['message'])) {
return $this->handleMessage($update['message']);
}
if (isset($update['callback_query'])) {
return $this->handleCallback($update['callback_query']);
}
return response()->json(['success' => true]);
}
protected function handleMessage(array $message)
{
$chatId = $message['chat']['id'];
$text = trim($message['text'] ?? '');
return $this->sendMessage($chatId, "Recibido: {$text}");
}
protected function handleCallback(array $callback)
{
$chatId = $callback['message']['chat']['id'];
$data = $callback['data'];
$this->answerCallbackQuery($callback['id'], 'OK');
return $this->sendMessage($chatId, "Botón: {$data}");
}
/*
|--------------------------------------------------------------------------
| CORE REQUEST
|--------------------------------------------------------------------------
*/
protected function request(string $method, array $payload = [])
{
return Http::timeout(60)
->post("{$this->baseUrl}/{$method}", $payload)
->json();
}
/*
|--------------------------------------------------------------------------
| MENSAJES BASE (TELEGRAM API)
|--------------------------------------------------------------------------
*/
public function sendMessage($chatId, $message, array $extra = [])
{
return $this->request('sendMessage', array_merge([
'chat_id' => $chatId,
'text' => $message,
'parse_mode' => 'HTML'
], $extra));
}
public function sendPhotoFile($chatId, $path, $caption = '')
{
// 🔥 CASO 1: URL (internet)
if (filter_var($path, FILTER_VALIDATE_URL)) {
return $this->request('sendPhoto', [
'chat_id' => $chatId,
'photo' => $path,
'caption' => $caption
]);
}
// 🔥 CASO 2: archivo local
if (!file_exists($path)) {
return response()->json([
'error' => 'Archivo no existe'
], 400);
}
return Http::attach(
'photo',
fopen($path, 'r'),
basename($path)
)->post("{$this->baseUrl}/sendPhoto", [
'chat_id' => $chatId,
'caption' => $caption
])->json();
}
public function sendAudioFile($chatId, $path, $caption = '')
{
return Http::attach(
'audio',
fopen($path, 'r'),
basename($path)
)->post("{$this->baseUrl}/sendAudio", [
'chat_id' => $chatId,
'caption' => $caption
])->json();
}
public function sendVideoFile($chatId, $path, $caption = '')
{
// 🔥 CASO 1: URL (internet)
if (filter_var($path, FILTER_VALIDATE_URL)) {
return $this->request('sendVideo', [
'chat_id' => $chatId,
'video' => $path,
'caption' => $caption
]);
}
// 🔥 CASO 2: archivo local
if (!file_exists($path)) {
return response()->json([
'error' => 'Archivo no existe'
], 400);
}
return Http::attach(
'video',
fopen($path, 'r'),
basename($path)
)->post("{$this->baseUrl}/sendVideo", [
'chat_id' => $chatId,
'caption' => $caption
])->json();
}
public function sendDocumentFile($chatId, $path, $caption = '')
{
return Http::attach(
'document',
fopen($path, 'r'),
basename($path)
)->post("{$this->baseUrl}/sendDocument", [
'chat_id' => $chatId,
'caption' => $caption
])->json();
}
/*
|--------------------------------------------------------------------------
| LOGS
|--------------------------------------------------------------------------
*/
public function sendLaravelLog(Request $request)
{
$file = storage_path('logs/laravel.log');
return $this->sendDocumentFile(
$request->chat_id,
$file,
'Laravel Log'
);
}
/*
|--------------------------------------------------------------------------
| CALLBACKS
|--------------------------------------------------------------------------
*/
public function answerCallbackQuery($id, $text = '')
{
return $this->request('answerCallbackQuery', [
'callback_query_id' => $id,
'text' => $text
]);
}
/*
|--------------------------------------------------------------------------
| BOT INFO
|--------------------------------------------------------------------------
*/
public function getMe()
{
return $this->request('getMe');
}
/*
|--------------------------------------------------------------------------
| WRAPPERS (TUS RUTAS API)
|--------------------------------------------------------------------------
*/
public function sendText(Request $request)
{
return $this->sendMessage($request->chat_id, $request->message);
}
public function sendImage(Request $request)
{
return $this->sendPhotoFile(
$request->chat_id,
$request->path,
$request->caption ?? ''
);
}
public function sendAudioApi(Request $request)
{
return $this->sendAudioFile(
$request->chat_id,
$request->path,
$request->caption ?? ''
);
}
public function sendVideoApi(Request $request)
{
return $this->sendVideoFile(
$request->chat_id,
$request->path,
$request->caption ?? ''
);
}
public function sendDocumentApi(Request $request)
{
return $this->sendDocumentFile(
$request->chat_id,
$request->path,
$request->caption ?? ''
);
}
public function sendLog(Request $request)
{
return $this->sendLaravelLog($request);
}
public function notify(Request $request)
{
return $this->sendMessage(
$request->chat_id,
$request->message
);
}
public function botInfo()
{
return $this->getMe();
}
public function getChatId(Request $request)
{
$updates = $this->request('getUpdates');
if (!$updates || !isset($updates['result'])) {
return response()->json([
'success' => false,
'message' => 'No hay mensajes'
]);
}
$chats = [];
foreach ($updates['result'] as $update) {
if (isset($update['message'])) {
$message = $update['message'];
$chats[] = [
'chat_id' => $message['chat']['id'] ?? null,
'type' => $message['chat']['type'] ?? null,
'username' => $message['chat']['username'] ?? null,
'first_name' => $message['chat']['first_name'] ?? null,
'text' => $message['text'] ?? null,
'date' => $message['date'] ?? null,
];
}
}
return response()->json([
'success' => true,
'chats' => $chats
]);
}
}

View File

@ -0,0 +1,480 @@
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Http;
class VuelosERPController extends Controller
{
protected int $sitio_web;
protected int $status;
public function __construct()
{
$this->sitio_web = config('sitioweb.sitio_web_erp_id', 0);
$this->status = 1; // Asumiendo que 1 es el estatus para vuelos activos
}
public function getVuelosNombresPreciosPublico()
{
$vuelos = DB::table('vuelos')
->where('id_sitio_web', $this->sitio_web)
->where('id_estatus', $this->status ?? 0)
->get();
$imagenes = DB::table('vuelos_imagenes_galeria')
->where('id_estatus', 1)
->orderBy('orden', 'asc')
->get()
->groupBy('id_vuelo');
$unidades = DB::table('unidades')
->where('id_estatus', 1)
->get()
->keyBy('id_unidad');
$vuelos->transform(function ($vuelo) use ($imagenes, $unidades) {
$vuelo->json_incluye = json_decode($vuelo->json_incluye, true);
$vuelo->precios_adicionales = collect(json_decode($vuelo->precios_adicionales, true))
->map(function ($item) use ($unidades) {
$idUnidad = (int) $item['id_unidad'];
return [
'id_unidad' => $idUnidad,
'precio' => (float) $item['precio'],
'unidad' => $unidades->has($idUnidad)
? [
'nombre_unidad' => $unidades[$idUnidad]->nombre_unidad,
'nombre_corto' => $unidades[$idUnidad]->nombre_corto,
'numero_personas_piezas' => $unidades[$idUnidad]->numero_personas_piezas,
]
: null
];
})
->values();
$vuelo->imagenes_galeria = $imagenes->get($vuelo->id_vuelo, collect())
->map(function ($img) {
return [
'id_imagen_vuelo' => $img->id_imagen_vuelo,
'ruta' => $img->ruta_imagen_vuelo,
'descripcion' => $img->descripcion_imagen_vuelo,
'orden' => $img->orden,
'imagen_destacada' => (bool) $img->imagen_destacada,
];
})
->values();
return $vuelo;
});
return response()->json(
$vuelos,
200,
[],
JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE
);
}
public function getServiciosAdicionales()
{
$response = Http::get('https://erp.skyballoons.mx/servicios-adicionales-webservice', [
'comercio' => 'skyballoons',
'key' => 'f093328776ae4cd210dc7b4ee4093e45',
]);
if ($response->successful()) {
$data = $response->json();
return response()->json(
$data,
200,
[],
JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE
);
} else {
return response()->json(['error' => 'No se pudieron obtener los servicios adicionales'], 500);
}
}
/*public function reservarVuelo(Request $request)
{
try {
//consultar el vuelo en globo
$vuelo = DB::table('vuelos')->where('id_vuelo', $request->id_vuelo)->first();
$data = [
// Datos del cliente
'nombre_reserva' => $request->responsable['nombres'],
'apellido_reserva' => $request->responsable['apellidos'],
'email_reserva' => $request->responsable['email'],
'tel_reserva' => preg_replace('/\D/', '', $request->responsable['telefono']),
'Lada' => 52,
'fecha_vuelo' => $request->fecha,
// Datos del vuelo
'id_vuelo' => $request->id_vuelo,
'id_unidad' => $vuelo->id_unidad,
'pasajeros' => ($request->adultos ?? 0) + ($request->ninios ?? 0),
'precio_publico' => $request->total,
// Totales
'total_compra' => $request->total,
// Pasajeros adicionales
'num_pax_adicionales' => 0,
'id_unidad_adicionales' => null,
'precio_adicional' => 0,
// Servicios adicionales
'servicios_adicionales' => collect($request->servicios ?? [])
->map(function ($servicio) {
return [
'id_servicio' => $servicio['id_servicio'],
'cantidad_solicitada' => $servicio['cantidad'] ?? 1,
'precio' => $servicio['precio'] ?? 0,
];
})
->toArray(),
];
return $data;
$resultado = $this->crearCotizacionCompleta($data);
return response()->json($resultado);
} catch (\Exception $e) {
return response()->json(['error' => 'Error al procesar la reserva: ' . $e->getMessage()], 500);
}
}*/
public function reservarVuelo(Request $request)
{
try {
// 1. BLINDAJE: Detectar si 'servicios' llegó como string JSON y parsearlo
$serviciosRaw = $request->servicios;
if (is_string($serviciosRaw)) {
$serviciosRaw = json_decode($serviciosRaw, true);
}
// Si no es un array válido tras el decode o viene vacío, asignamos un array limpio
$serviciosArray = is_array($serviciosRaw) ? $serviciosRaw : [];
// Consultar el vuelo en globo
$vuelo = DB::table('vuelos')->where('id_vuelo', $request->id_vuelo)->first();
if (!$vuelo) {
return response()->json(['error' => 'El vuelo solicitado no existe.'], 404);
}
$data = [
// Datos del cliente
'nombre_reserva' => $request->responsable['nombres'] ?? '',
'apellido_reserva' => $request->responsable['apellidos'] ?? '',
'email_reserva' => $request->responsable['email'] ?? '',
'tel_reserva' => preg_replace('/\D/', '', $request->responsable['telefono'] ?? ''),
'Lada' => 52,
'fecha_vuelo' => $request->fecha,
// Datos del vuelo
'id_vuelo' => $vuelo->id_vuelo,
'id_unidad' => $vuelo->id_unidad,
'pasajeros' => ($request->adultos ?? 0) + ($request->ninios ?? 0),
'precio_publico' => $request->total,
// Totales
'total_compra' => $request->total,
// Pasajeros adicionales
'num_pax_adicionales' => 0,
'id_unidad_adicionales' => null,
'precio_adicional' => 0,
// Servicios adicionales (procesados de forma segura)
'servicios_adicionales' => collect($serviciosArray)
->map(function ($servicio) {
return [
'id_servicio' => $servicio['id_servicio'] ?? null,
'cantidad_solicitada' => $servicio['cantidad'] ?? 1,
'precio' => $servicio['precio'] ?? 0,
];
})
->filter(fn($s) => !is_null($s['id_servicio'])) // Quita elementos mal formados
->toArray(),
];
// ⚠️ NOTA: Eliminamos el 'return $data;' para que el flujo continúe hacia la cotización real.
$id_cotizacion = $this->crearCotizacionCompleta($data);
$route = route('checkout.detalle.cotizacion.chatbot', ['cotizacion' => $id_cotizacion]);
return response()->json(['id_cotizacion' => $id_cotizacion, 'route' => $route]);
} catch (\Exception $e) {
return response()->json(['error' => 'Error al procesar la reserva: ' . $e->getMessage()], 500);
}
}
public function crearCotizacionCompleta(array $data)
{
try {
DB::beginTransaction();
// 1. Generar folio
$ultimoId = (DB::table('cotizaciones')->max('id_cotizacion') ?? 0) + 1;
$folio = "COT" . str_pad($ultimoId, 7, "0", STR_PAD_LEFT);
$vuelo = DB::table('vuelos')->where('id_vuelo', $data['id_vuelo'])->where('id_estatus', 1)->where('id_sitio_web', $this->sitio_web)->first() ?? null;
// 2. Insertar cotización principal
$id_cotizacion = DB::table('cotizaciones')->insertGetId([
'folio' => $folio,
'nombre' => $data['nombre_reserva'],
'apellidos' => $data['apellido_reserva'],
'mail' => $data['email_reserva'],
'telefono' => $data['tel_reserva'],
'iso_country_id_primary_phone' => $data['Lada'],
'subtotal' => $data['total_compra'],
'total' => $data['total_compra'],
'total_con_iva' => $data['total_compra'],
'total_neto' => $data['total_compra'],
'id_sitio_web' => $this->sitio_web,
'observaciones' => 'Cotizacion desde www.vueloenglobo.mx',
'id_user_alta' => 98,
'fecha_alta' => now(),
'fecha_vuelo' => $data['fecha_vuelo'] ?? null,
]);
// 3. Insertar vuelo principal
DB::table('vuelos_cotizaciones')->insert([
'id_cotizacion' => $id_cotizacion,
'id_vuelo' => $vuelo->id_vuelo,
'id_unidad' => $data['id_unidad'],
'cantidades' => $data['pasajeros'],
'precio_vendido_p_pax_vuelo' => $vuelo->precio_publico,
'precio_especial' => $vuelo->precio_publico,
'id_estatus' => 1,
'id_user_alta' => 98,
'fecha_alta' => now(),
]);
// 4. Pasajeros adicionales
/* if (!empty($data['num_pax_adicionales']) && $data['num_pax_adicionales'] > 0) {
DB::table('vuelos_cotizaciones')->insert([
'id_cotizacion' => $id_cotizacion,
'id_vuelo' => $data['id_vuelo'],
'id_unidad' => $data['id_unidad_adicionales'],
'cantidades' => $data['num_pax_adicionales'],
'precio_vendido_p_pax_vuelo' => $data['precio_adicional'],
'pasajero_adicional' => 1,
'id_estatus' => 1,
'id_user_alta' => 98,
'fecha_alta' => now(),
]);
}*/
// 5. Servicios adicionales
if (!empty($data['servicios_adicionales'])) {
$servicios = is_string($data['servicios_adicionales'])
? json_decode($data['servicios_adicionales'], true)
: $data['servicios_adicionales'];
foreach ($servicios as $servicio) {
DB::table('servicios_adicionales_cotizaciones')->insert([
'id_cotizacion' => $id_cotizacion,
'id_servicio_adicional' => $servicio['id_servicio'],
'cantidades' => $servicio['cantidad_solicitada'],
'precio_vendido' => $servicio['precio'],
'id_estatus' => 1,
'id_user_alta' => 98,
'fecha_alta' => now(),
]);
}
}
DB::commit();
return $id_cotizacion;
return [
'success' => true,
'id_cotizacion' => $id_cotizacion,
'folio' => $folio
];
} catch (\Exception $e) {
DB::rollBack();
return [
'success' => false,
'error' => $e->getMessage()
];
}
}
/*
public function efectuarPago(Request $request)
{
try {
$cotizacion_id = $request->id_cotizacion ?? 0;
$cotizacion = DB::table('cotizaciones')->where('id_cotizacion', $cotizacion_id)->first();
//aqui va lo del pago con clip, si se efectua entonces se generan el pase de abordar y el pedido
DB::table('pases_de_abordar')->insert([
'id_cotizacion' => $cotizacion_id,
'id_lugar_cita' => 12,
'hora_cita' => '06:00',
'id_recibo' => 0,
'id_estatus' => 1,
'id_user_alta' => 98,
'fecha_alta' => now(),
]);
DB::table('pedidos')->insert([
'id_cotizacion' => $cotizacion_id,
'foto_comprobante' => null,
'cantidad_pagada' => $cotizacion->total_neto,
'pago_confirmado' => 1,
'fecha_pago' => date('Y-m-d'),
'observaciones' => 'Transacción realizada vía Clip PAGO CON TARJETA desde vueloenglobo.mx | ' . $cotizacion->nombre . ' ' . $cotizacion->apellidos . ' - ID Cotizacion:' . $cotizacion_id,
'observaciones_logistica' => 'Transacción realizada vía Clip PAGO CON TARJETA desde vueloenglobo.mx | ' . $cotizacion->nombre . ' ' . $cotizacion->apellidos . ' - ID Cotizacion:' . $cotizacion_id,
'ultimos_digitos' => null,
'id_cuenta_bancaria' => 1,
'id_metodo_pago_cuenta_bancaria' => 9,
'id_banco' => 0,
'id_estatus' => 1,
'id_user_alta' => 98,
'fecha_alta' => now(),
]);
$url = url('https://erp.skyballoons.mx/enviar-pase/2/' . $cotizacion_id);
Http::get($url);
} catch (\Exception $e) {
return response()->json([
'success' => false,
'message' => 'Error al procesar el pago: ' . $e->getMessage()
], 500);
}
}*/
public function efectuarPago(Request $request)
{
try {
$validated = $request->validate([
'token' => 'required|string',
'id_cotizacion' => 'required|integer'
]);
$cotizacion = DB::table('cotizaciones')
->where('id_cotizacion', $validated['id_cotizacion'])
->first();
if (!$cotizacion) {
return response()->json([
'success' => false,
'message' => 'Cotización no encontrada'
], 404);
}
// ==========================
// COBRO CON CLIP
// ==========================
$payload = [
'amount' => (float) $cotizacion->total_neto,
'currency' => 'MXN',
'description' => 'Pago vuelo en globo - ' . $cotizacion->folio,
'payment_method' => [
'token' => $validated['token']
],
'customer' => [
'email' => $cotizacion->mail,
'phone' => $cotizacion->telefono
]
];
$response = Http::withHeaders([
'Authorization' => 'Bearer ' . config('clip.api_key'),
'Content-Type' => 'application/json',
])->post(config('clip.payments_url'), $payload);
// 🔴 FALLO TOTAL: cortar flujo
if (!$response->successful()) {
return response()->json([
'success' => false,
'message' => $response->json('detail') ?? 'Pago rechazado',
'clip_response' => $response->json()
], 400);
}
$clipPayment = $response->json();
// 🔴 VALIDAR ESTATUS REAL DEL PAGO (MUY IMPORTANTE)
if (($clipPayment['status'] ?? null) !== 'approved') {
return response()->json([
'success' => false,
'message' => 'El pago no fue aprobado',
'clip_response' => $clipPayment
], 400);
}
// ==========================
// SOLO SI FUE APROBADO
// ==========================
DB::beginTransaction();
DB::table('pases_de_abordar')->insert([
'id_cotizacion' => $cotizacion->id_cotizacion,
'id_lugar_cita' => 12,
'hora_cita' => '06:00',
'id_recibo' => 0,
'id_estatus' => 1,
'id_user_alta' => 98,
'fecha_alta' => now(),
]);
DB::table('pedidos')->insert([
'id_cotizacion' => $cotizacion->id_cotizacion,
'foto_comprobante' => null,
'cantidad_pagada' => $cotizacion->total_neto,
'pago_confirmado' => 1,
'fecha_pago' => now(),
'observaciones' => 'Clip payment ID: ' . ($clipPayment['id'] ?? ''),
'observaciones_logistica' => 'Clip payment ID: ' . ($clipPayment['id'] ?? ''),
'ultimos_digitos' => $clipPayment['payment_method']['card']['last4'] ?? null,
'id_cuenta_bancaria' => 1,
'id_metodo_pago_cuenta_bancaria' => 9,
'id_banco' => 0,
'id_estatus' => 1,
'id_user_alta' => 98,
'fecha_alta' => now(),
]);
DB::commit();
Http::timeout(30)->get(
'https://erp.skyballoons.mx/enviar-pase/2/' . $cotizacion->id_cotizacion
);
return response()->json([
'success' => true,
'message' => 'Pago realizado correctamente',
'payment_id' => $clipPayment['id'] ?? null
]);
} catch (\Exception $e) {
DB::rollBack();
return response()->json([
'success' => false,
'message' => $e->getMessage()
], 500);
}
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class ApiConsultasController extends Controller
{
public function todosLosVuelos()
{
return ApiVuelosController::getBySitioWeb(6);
}
public function vuelosConCategoria()
{
return ApiVuelosController::getWithCategoria(6);
}
public function vuelosConPrecios()
{
return ApiVuelosController::getWithPrecios(6);
}
}

View File

@ -0,0 +1,124 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class ApiVuelosController extends Controller
{
/**
* Obtener todos los vuelos por sitio web
*/
public static function getBySitioWeb($sitioId = 6)
{
return DB::table('vuelos')
->where('id_sitio_web', $sitioId)
->where('id_estatus', 1)
->get();
}
/**
* Obtener vuelos con categoría
*/
public static function getWithCategoria($sitioId = 6)
{
return DB::table('vuelos as v')
->join('categorias_vuelos as c', 'v.id_categoria', '=', 'c.id_categoria')
->select(
'v.*',
'c.nombre_categoria'
)
->where('v.id_sitio_web', $sitioId)
->where('v.id_estatus', 1)
->get();
}
/**
* Obtener vuelos con precios
*/
public static function getWithPrecios($sitioId = 6)
{
return DB::table('vuelos as v')
->leftJoin('vuelos_precios as p', 'v.id_vuelo', '=', 'p.id_vuelo')
->select(
'v.id_vuelo',
'v.nombre_vuelo',
'p.precio_vuelo_original',
'p.precio_vuelo_especial',
'p.moneda_precio'
)
->where('v.id_sitio_web', $sitioId)
->where('v.id_estatus', 1)
->get();
}
/**
* Obtener vuelos con imágenes
*/
public static function getWithGaleria($sitioId = 6)
{
return DB::table('vuelos as v')
->leftJoin('vuelos_imagenes_galeria as g', 'v.id_vuelo', '=', 'g.id_vuelo')
->select(
'v.id_vuelo',
'v.nombre_vuelo',
'g.ruta_imagen_vuelo',
'g.imagen_destacada'
)
->where('v.id_sitio_web', $sitioId)
->where('v.id_estatus', 1)
->get();
}
/**
* Obtener vuelos con items incluidos
*/
public static function getWithIncluye($vueloId)
{
return DB::table('vuelos_items_incluye')
->where('id_vuelo', $vueloId)
->where('id_estatus', 1)
->get();
}
/**
* Obtener fechas bloqueadas de un vuelo
*/
public static function getFechasBloqueadas($vueloId)
{
return DB::table('fechas_vuelos_bloqueadas')
->where('id_vuelo', $vueloId)
->where('id_estatus', 1)
->pluck('fechas_vuelo');
}
/**
* Obtener fechas disponibles para venta
*/
public static function getFechasVenta($vueloId)
{
return DB::table('vuelos_fechas_venta')
->where('id_vuelo', $vueloId)
->where('id_estatus', 1)
->pluck('fecha_venta');
}
/**
* Obtener vuelos con precios en USD
*/
public static function getVuelosUSD($sitioId = 6)
{
return DB::table('vuelos as v')
->join('vuelos_usd as u', 'v.id_vuelo', '=', 'u.id_vuelo')
->select(
'v.id_vuelo',
'v.nombre_vuelo',
'u.precio_usd',
'u.precio_especial_usd'
)
->where('v.id_sitio_web', $sitioId)
->where('v.id_estatus', 1)
->get();
}
}

View File

@ -0,0 +1,39 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ConfirmsPasswords;
class ConfirmPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Confirm Password Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password confirmations and
| uses a simple trait to include the behavior. You're free to explore
| this trait and override any functions that require customization.
|
*/
use ConfirmsPasswords;
/**
* Where to redirect users when the intended url fails.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
}

View File

@ -0,0 +1,22 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
class ForgotPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset emails and
| includes a trait which assists in sending these notifications from
| your application to your users. Feel free to explore this trait.
|
*/
use SendsPasswordResetEmails;
}

View File

@ -0,0 +1,40 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/
use AuthenticatesUsers;
/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest')->except('logout');
$this->middleware('auth')->only('logout');
}
}

View File

@ -0,0 +1,71 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Models\User;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
class RegisterController extends Controller
{
/*
|--------------------------------------------------------------------------
| Register Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users as well as their
| validation and creation. By default this controller uses a trait to
| provide this functionality without requiring any additional code.
|
*/
use RegistersUsers;
/**
* Where to redirect users after registration.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
/**
* Get a validator for an incoming registration request.
*
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
]);
}
/**
* Create a new user instance after a valid registration.
*
* @return User
*/
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
]);
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;
class ResetPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset requests
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
*/
use ResetsPasswords;
/**
* Where to redirect users after resetting their password.
*
* @var string
*/
protected $redirectTo = '/home';
}

View File

@ -0,0 +1,41 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\VerifiesEmails;
class VerificationController extends Controller
{
/*
|--------------------------------------------------------------------------
| Email Verification Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling email verification for any
| user that recently registered with the application. Emails may also
| be re-sent if the user didn't receive the original email message.
|
*/
use VerifiesEmails;
/**
* Where to redirect users after verification.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
$this->middleware('signed')->only('verify');
$this->middleware('throttle:6,1')->only('verify', 'resend');
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
use AuthorizesRequests, ValidatesRequests;
}

View File

@ -0,0 +1,388 @@
<?php
namespace App\Http\Controllers;
use Http;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Http as FacadesHttp;
class CotizacionController extends Controller
{
protected static $sitio_web_id = 2; // ID fijo para globopuerto
/**
* Summary of crearCotizacionYPosibleCompraErp
* @param array $datos
* @return array{error: string, exito: int|array{exito: int, folio: string, id_cotizacion: int}}
*/
public static function crearCotizacionYPosibleCompraErp(array $datos)
{
try {
DB::beginTransaction();
$ultimoId = DB::table('cotizaciones')->max('id_cotizacion') + 1;
$folio = 'COT' . str_pad($ultimoId, 7, '0', STR_PAD_LEFT);
$id_cotizacion = DB::table('cotizaciones')->insertGetId([
'folio' => $folio,
'nombre' => $datos['nombre'],
'apellidos' => $datos['apellidos'],
'mail' => $datos['email'],
'telefono' => $datos['telefono'],
'total' => $datos['total_compra'],
'subtotal' => $datos['total_compra'],
'id_sitio_web' => self::$sitio_web_id,
'id_user_alta' => 98,
'fecha_alta' => Carbon::now(),
]);
DB::table('posibles_compras')->insert([
'id_cotizacion' => $id_cotizacion,
'id_sitio_web' => self::$sitio_web_id,
'total_reservado' => $datos['total_compra'],
'total_reserva' => $datos['total_a_pagar'],
'fecha_alta' => Carbon::now(),
]);
DB::commit();
return [
'exito' => 1,
'id_cotizacion' => $id_cotizacion,
'folio' => $folio
];
} catch (\Exception $e) {
DB::rollBack();
return [
'exito' => 0,
'error' => $e->getMessage()
];
}
}
public function crearCotizacionCompleta(array $data)
{
try {
DB::beginTransaction();
// 1. Generar folio
$ultimoId = (DB::table('cotizaciones')->max('id_cotizacion') ?? 0) + 1;
$folio = "COT" . str_pad($ultimoId, 7, "0", STR_PAD_LEFT);
$vuelo = DB::table('vuelos')->where('id_vuelo', $data['id_vuelo'])->first();
// 2. Insertar cotización principal
$id_cotizacion = DB::table('cotizaciones')->insertGetId([
'folio' => $folio,
'nombre' => $data['nombre_reserva'],
'apellidos' => $data['apellido_reserva'],
'mail' => $data['email_reserva'],
'telefono' => $data['tel_reserva'],
'iso_country_id_primary_phone' => $data['Lada'],
'subtotal' => $data['total_compra'],
'total' => $data['total_compra'],
'total_con_iva' => $data['total_compra'],
'total_neto' => $data['total_compra'],
'id_sitio_web' => self::$sitio_web_id,
'observaciones' => 'Cotizacion desde www.vueloenglobo.mx',
'id_user_alta' => 98,
'fecha_alta' => now(),
'fecha_vuelo' => $data['fecha_vuelo'] ?? null,
]);
// 3. Insertar vuelo principal
DB::table('vuelos_cotizaciones')->insert([
'id_cotizacion' => $id_cotizacion,
'id_vuelo' => $data['id_vuelo'],
'id_unidad' => $data['id_unidad'],
'cantidades' => $data['pasajeros'],
'precio_vendido_p_pax_vuelo' => $vuelo->precio_publico,
'precio_especial' => $vuelo->precio_publico,
'id_estatus' => 1,
'id_user_alta' => 98,
'fecha_alta' => now(),
]);
DB::table('pedidos')->insert([
'id_cotizacion' => $id_cotizacion,
'foto_comprobante' => null,
'cantidad_pagada' => $data['total_compra'],
'pago_confirmado' => 1,
'fecha_pago' => date('Y-m-d'),
'observaciones' => 'Transacción realizada vía Clip PAGO CON TARJETA desde vueloenglobo.mx | ' . $data['nombre_reserva'] . ' ' . $data['apellido_reserva'] . ' - ID Cotizacion:' . $id_cotizacion,
'observaciones_logistica' => 'Transacción realizada vía Clip PAGO CON TARJETA desde vueloenglobo.mx | ' . $data['nombre_reserva'] . ' ' . $data['apellido_reserva'] . ' - ID Cotizacion:' . $id_cotizacion,
'ultimos_digitos' => null,
'id_cuenta_bancaria' => 1,
'id_metodo_pago_cuenta_bancaria' => 9,
'id_banco' => 0,
'id_estatus' => 1,
'id_user_alta' => 98,
'fecha_alta' => now(),
]);
DB::table('pases_de_abordar')->insert([
'id_cotizacion' => $id_cotizacion,
'id_lugar_cita' => 12,
'hora_cita' => '06:00',
'id_recibo' => 0,
'id_estatus' => 1,
'id_user_alta' => 98,
'fecha_alta' => now(),
]);
// 4. Pasajeros adicionales
if (!empty($data['num_pax_adicionales']) && $data['num_pax_adicionales'] > 0) {
DB::table('vuelos_cotizaciones')->insert([
'id_cotizacion' => $id_cotizacion,
'id_vuelo' => $data['id_vuelo'],
'id_unidad' => $data['id_unidad_adicionales'],
'cantidades' => $data['num_pax_adicionales'],
'precio_vendido_p_pax_vuelo' => $data['precio_adicional'],
'pasajero_adicional' => 1,
'id_estatus' => 1,
'id_user_alta' => 98,
'fecha_alta' => now(),
]);
}
// 5. Servicios adicionales
if (!empty($data['servicios_adicionales'])) {
$servicios = is_string($data['servicios_adicionales'])
? json_decode($data['servicios_adicionales'], true)
: $data['servicios_adicionales'];
foreach ($servicios as $servicio) {
DB::table('servicios_adicionales_cotizaciones')->insert([
'id_cotizacion' => $id_cotizacion,
'id_servicio_adicional' => $servicio['id_servicio'],
'cantidades' => $servicio['cantidad_solicitada'],
'precio_vendido' => $servicio['precio'],
'id_estatus' => 1,
'id_user_alta' => 98,
'fecha_alta' => now(),
]);
}
}
$url = url('https://erp.skyballoons.mx/enviar-pase/2/' . $id_cotizacion);
FacadesHttp::get($url);
DB::commit();
return [
'success' => true,
'id_cotizacion' => $id_cotizacion,
'folio' => $folio
];
} catch (\Exception $e) {
DB::rollBack();
return [
'success' => false,
'error' => $e->getMessage()
];
}
}
public function generaCot(Request $request)
{
$data = [
// Datos del cliente
'nombre_reserva' => $request->responsable['nombres'],
'apellido_reserva' => $request->responsable['apellidos'],
'email_reserva' => $request->responsable['email'],
'tel_reserva' => preg_replace('/\D/', '', $request->responsable['telefono']),
'Lada' => 52, // o extraerla dinámicamente
'fecha_vuelo' => $request->fecha,
// Datos del vuelo
'id_vuelo' => $request->id_vuelo,
'id_unidad' => 1, // obtener según tu lógica de negocio
'pasajeros' => ($request->adultos ?? 0) + ($request->ninios ?? 0),
'precio_publico' => $request->total,
// Totales
'total_compra' => $request->total,
// Pasajeros adicionales
'num_pax_adicionales' => 0,
'id_unidad_adicionales' => null,
'precio_adicional' => 0,
// Servicios adicionales
'servicios_adicionales' => collect($request->servicios ?? [])
->map(function ($servicio) {
return [
'id_servicio' => $servicio['id_servicio'],
'cantidad_solicitada' => $servicio['cantidad'] ?? 1,
'precio' => $servicio['precio'] ?? 0,
];
})
->toArray(),
];
$resultado = $this->crearCotizacionCompleta($data);
return response()->json($resultado);
}
/* public function detalleCotizacionChatbot(Request $request, $cotizacion)
{
$pedidos = DB::table('pedidos')
->where('id_cotizacion', $cotizacion)
->first() ?? null;
if ($pedidos) {
return response()->json(['error' => 'La cotización ya ha sido pagada.']);
}
// return $pago!=null? response()->json(['error' => 'La cotización ya ha sido pagada.']) : '';
$cotizacion = DB::table('cotizaciones')
->where('id_cotizacion', $cotizacion)
->first();
$vueloCotizado = DB::table('vuelos_cotizaciones')
->where('id_cotizacion', $cotizacion->id_cotizacion)
->first();
$vuelo = DB::table('vuelos')
->where('id_vuelo', $vueloCotizado->id_vuelo)
->first();
$resultado = [
'folio' => $cotizacion->folio,
'cliente' => $cotizacion->nombre . ' ' . $cotizacion->apellidos,
'email' => $cotizacion->mail,
'telefono' => $cotizacion->telefono,
'fecha_vuelo' => $cotizacion->fecha_vuelo,
'total' => $cotizacion->total,
'moneda' => $cotizacion->tipo_moneda,
'vuelo' => [
'id_vuelo_cotizacion' => $vueloCotizado->id_vuelo_cotizacion,
'cantidad_pax' => $vueloCotizado->cantidades,
'precio_unitario' => $vueloCotizado->precio_vendido_p_pax_vuelo,
'precio_especial' => $vueloCotizado->precio_especial,
]
];
$adicionalesCotizados = DB::table('servicios_adicionales_cotizaciones')
->where('id_cotizacion', $cotizacion->id_cotizacion)
->get();
return $adicionalesCotizados;
$datosPago = [
'total' => $cotizacion->total_neto ?? 0,
'moneda' => $cotizacion->moneda ?? 'MXN',
'simbolo' => ($cotizacion->moneda ?? 'MXN') === 'USD' ? 'US$' : '$',
'descripcionPago' => $cotizacion->folio ?? 'Vuelo cotizado',
'id_cotizacion' => $cotizacion->id_cotizacion,
'vuelo' => $cotizacion->folio,
'adicionales' => $adicionalesCotizados,
'responsable' => [
'nombres' => $cotizacion->nombre ?? '',
'apellidos' => $cotizacion->apellidos ?? '',
'email' => $cotizacion->mail ?? '',
'telefono' => $cotizacion->telefono ?? '',
],
'fecha_vuelo' => $cotizacion->fecha_vuelo ?? null,
'adultos' => $cotizacion->adultos ?? 1,
'ninios' => $cotizacion->ninios ?? 0,
'isSpanish' => app()->getLocale() === 'es',
];
// return $vuelo;
return view('cotizacion.chatbot.checkout', compact('datosPago', 'vueloCotizado', 'adicionalesCotizados', 'vuelo'));
} */
public function detalleCotizacionChatbot(Request $request, $cotizacion)
{
// Verificar si ya está pagada
$pedidos = DB::table('pedidos')
->where('id_cotizacion', $cotizacion)
->first();
if ($pedidos) {
return response()->json(['error' => 'La cotización ya ha sido pagada.']);
}
// Obtener cotización
$cotizacion = DB::table('cotizaciones')
->where('id_cotizacion', $cotizacion)
->first();
if (!$cotizacion) {
return response()->json(['error' => 'Cotización no encontrada']);
}
// Obtener vuelo cotizado
$vueloCotizado = DB::table('vuelos_cotizaciones')
->where('id_cotizacion', $cotizacion->id_cotizacion)
->first();
$vuelo = null;
if ($vueloCotizado) {
$vuelo = DB::table('vuelos')
->where('id_vuelo', $vueloCotizado->id_vuelo)
->first();
}
// Obtener adicionales
$adicionalesCotizados = DB::table('servicios_adicionales_cotizaciones')
->where('id_cotizacion', $cotizacion->id_cotizacion)
->get();
// Preparar array datosPago
$datosPago = [
'total' => $cotizacion->total ?? 0,
'moneda' => $cotizacion->tipo_moneda ?? 'MXN',
'simbolo' => ($cotizacion->tipo_moneda ?? 'MXN') === 'USD' ? 'US$' : '$',
'descripcionPago' => $cotizacion->folio ?? 'Vuelo cotizado',
'id_cotizacion' => $cotizacion->id_cotizacion,
'vuelo_folio' => $cotizacion->folio,
'adicionales' => $adicionalesCotizados,
'responsable' => [
'nombres' => $cotizacion->nombre ?? '',
'apellidos' => $cotizacion->apellidos ?? '',
'email' => $cotizacion->mail ?? '',
'telefono' => $cotizacion->telefono ?? '',
],
'fecha_vuelo' => $cotizacion->fecha_vuelo ?? null,
'adultos' => $cotizacion->adultos ?? 1,
'ninios' => $cotizacion->ninios ?? 0,
'isSpanish' => app()->getLocale() === 'es',
// Información del vuelo
'nombre_vuelo' => $vuelo->nombre_vuelo ?? 'Vuelo sin nombre',
'json_incluye' => isset($vuelo->json_incluye) ? json_decode($vuelo->json_incluye, true) : [],
'cantidad_pax' => $vueloCotizado->cantidades ?? 0,
'precio_unitario' => $vueloCotizado->precio_vendido_p_pax_vuelo ?? 0,
];
return view('cotizacion.chatbot.checkout', compact('datosPago', 'vueloCotizado', 'adicionalesCotizados', 'vuelo'));
}
public function compraFinalizada(Request $request)
{
$objCotizacion = null;
if (isset($request->cotizacion)) {
$objCotizacion = DB::table('cotizaciones')
->where('id_cotizacion', decrypt($request->cotizacion))
->first();
}
return view('cotizacion.chatbot.success');
}
}

View File

@ -0,0 +1,256 @@
<?php
namespace App\Http\Controllers;
use App\Models\Cotizaciones;
use App\Models\Vuelos;
use App\Models\VuelosCotizaciones;
use Exception;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Http;
class EsConsultasController extends Controller
{
//
public static function getVueloCompleto()
{
/** */
$vuelos = Vuelos::select(
'vuelos.id_vuelo',
'vuelos.nombre_vuelo',
'vuelos.enlace_permanente',
'vuelos.precio_publico',
'vuelos.precio_especial',
'unidades.nombre_unidad'
)
->where([
['vuelos.id_sitio_web', 6],
['vuelos.visibilidad_pagina_web', 1]
])
->rightJoin('unidades', 'vuelos.id_unidad', '=', 'unidades.id_unidad')
->orderBy('vuelos.id_vuelo', 'desc')
->get();
return $vuelos;
}
public static function getDatosVuelo($vuelo)
{
$sql = DB::select("
SELECT
sitios_web.*,
vuelos.id_vuelo AS aux_id_vuelo,
(
SELECT COUNT(1)
FROM recibos_conceptos rc
WHERE rc.id = vuelos.id_vuelo
AND rc.tipo = 'vuelo'
) AS numero_de_veces_vendido_vuelos,
unidades.id_unidad,
unidades.nombre_unidad,
unidades.nombre_corto,
unidades.nombre_unidad_enUS,
unidades.nombre_corto_enUS,
unidades.numero_personas_piezas,
categorias_vuelos.nombre_categoria,
IFNULL(galeria.id_galeria, 0) AS id_galeria,
galeria.json_rutas_imagenes AS imagenes_galeria,
IFNULL(galeria.nombre_galeria, 0) AS nombre_galeria,
vuelos.*,
ubicaciones.id_ubicacion,
CONCAT(
'ID: ', ubicaciones.id_ubicacion, ' - ',
ubicaciones.nombre_ubicacion, ', ',
ubicaciones.estado, ', ',
paises.langES
) AS nombre_ubicacion,
IFNULL(vuelos_usd.titulo_vuelo, vuelos.nombre_vuelo) AS titulo_vuelo_usd,
vuelos.nombre_vuelo AS titulo_vuelo,
IFNULL(vuelos_usd.json_incluye, vuelos.json_incluye) AS json_incluye_usd,
IFNULL(vuelos_usd.precio_usd, 0) AS precio_usd
FROM vuelos
LEFT JOIN vuelos_usd
ON vuelos_usd.id_vuelo = vuelos.id_vuelo
LEFT JOIN galeria
ON galeria.id_galeria = vuelos.id_galeria
INNER JOIN ubicaciones
ON vuelos.id_ubicacion = ubicaciones.id_ubicacion
INNER JOIN paises
ON ubicaciones.id_pais = paises.code
INNER JOIN categorias_vuelos
ON vuelos.id_categoria = categorias_vuelos.id_categoria
INNER JOIN unidades
ON unidades.id_unidad = vuelos.id_unidad
LEFT JOIN sitios_web
ON sitios_web.id_sitio_web = vuelos.id_sitio_web
WHERE
vuelos.id_estatus = 1
AND vuelos.id_sitio_web = ?
AND vuelos.enlace_permanente = ?
AND vuelos.visibilidad_pagina_web = 1
AND vuelos.no_se_vera_en_home_vuelos = 0
ORDER BY numero_de_veces_vendido_vuelos DESC
", [6, $vuelo]);
return $sql;
}
public static function getInfoVuelo($vuelo)
{
return DB::select("
SELECT sitios_web.*,
vuelos.id_vuelo as aux_id_vuelo,
(SELECT COUNT(1)
FROM recibos_conceptos
WHERE recibos_conceptos.id = vuelos.id_vuelo
AND recibos_conceptos.tipo = 'vuelo') as numero_de_veces_vendido_vuelos,
unidades.id_unidad,
unidades.nombre_unidad,
unidades.nombre_corto,
unidades.nombre_unidad_enUS,
unidades.nombre_corto_enUS,
unidades.numero_personas_piezas,
categorias_vuelos.nombre_categoria,
IFNULL(galeria.id_galeria, 0) AS id_galeria,
galeria.json_rutas_imagenes AS imagenes_galeria,
IFNULL(galeria.nombre_galeria, 0) AS nombre_galeria,
vuelos.*,
ubicaciones.id_ubicacion,
CONCAT('ID: ', ubicaciones.id_ubicacion, ' - ', ubicaciones.nombre_ubicacion, ', ', ubicaciones.estado, ', ', paises.langES) AS nombre_ubicacion,
IFNULL(vuelos_usd.titulo_vuelo, vuelos.nombre_vuelo) AS titulo_vuelo_usd,
vuelos.nombre_vuelo AS titulo_vuelo,
IFNULL(vuelos_usd.json_incluye, vuelos.json_incluye) AS json_incluye_usd,
IFNULL(vuelos_usd.precio_usd, 0) AS precio_usd
FROM vuelos
LEFT JOIN vuelos_usd ON vuelos_usd.id_vuelo = vuelos.id_vuelo
LEFT JOIN galeria ON galeria.id_galeria = vuelos.id_galeria
INNER JOIN ubicaciones ON vuelos.id_ubicacion = ubicaciones.id_ubicacion
INNER JOIN paises ON ubicaciones.id_pais = paises.code
INNER JOIN categorias_vuelos ON vuelos.id_categoria = categorias_vuelos.id_categoria
INNER JOIN unidades ON unidades.id_unidad = vuelos.id_unidad
LEFT JOIN sitios_web ON sitios_web.id_sitio_web = vuelos.id_sitio_web
WHERE vuelos.id_estatus = 1
AND vuelos.enlace_permanente = ?
AND vuelos.visibilidad_pagina_web = 1
AND vuelos.no_se_vera_en_home_vuelos = 0
ORDER BY numero_de_veces_vendido_vuelos DESC
", [$vuelo]);
}
public static function obtenerCotizacion()
{
$id_cotizacion = (Cotizaciones::max('id_cotizacion') ?? 0) + 1;
return [
"folio" => "COT" . str_pad($id_cotizacion, 7, "0", STR_PAD_LEFT),
"id_cotizacion" => $id_cotizacion
];
}
public function registrarCotizacion(Request $request)
{
try {
$pasajeros = $request->input('num_pasajeros');
$folio_cotizaciones = EsConsultasController::obtenerCotizacion();
$vuelo = new Vuelos;
$vuelo_cotizacion = new VuelosCotizaciones();
$cotizaciones = new Cotizaciones();
$datos_vuelo = $vuelo::where(['nombre_vuelo' => $request->input('vuelo_elegido'), 'id_sitio_web' => 6])->get();
$datos_vuelo = json_decode($datos_vuelo, true);
$total = $pasajeros * (int)$datos_vuelo[0]["precio_publico"];
$cotizaciones->id_sitio_web = 6;
$cotizaciones->folio = $folio_cotizaciones['folio'];
$cotizaciones->nombre = ($request->has('nombre') ? $request->input('nombre') : $request->input('email'));
$cotizaciones->apellidos = ($request->has('apellido') ? $request->input('apellido') : 'N/A');
$cotizaciones->id_medio_contacto = 13;
$cotizaciones->id_genero = 1;
$cotizaciones->telefono = $request->input('phone');
$cotizaciones->celular = $request->input('phone');
$cotizaciones->cp = 0;
$cotizaciones->mail = $request->input('email');
$cotizaciones->fecha_vuelo = ($request->input('fecha_vuelo_cot') == null ? null : $request->input('fecha_vuelo_cot'));
$cotizaciones->cotizacion_abierta = ($request->input('fecha_vuelo_cot') == null ? 1 : 0);
$cotizaciones->vuelos = $request->input('vuelo_elegido');
$cotizaciones->servicios_adicionales = "";
$cotizaciones->tipo_descuento = 0;
$cotizaciones->descuento = 0;
$cotizaciones->subtotal = $total;
$cotizaciones->total = $total;
$cotizaciones->total_con_iva = $total;
$cotizaciones->requiere_factura = 0;
$cotizaciones->observaciones = "Cotizacion desde www.globopuertoteotihuacan.com";
$cotizaciones->tipo_moneda = "MXN";
$cotizaciones->pais_persona = 484;
$cotizaciones->estado_persona = 1;
$cotizaciones->id_estatus = 1;
$cotizaciones->fecha_alta = Carbon::now();
$cotizaciones->id_user_alta = 98;
$cotizaciones->save();
$vuelo_cotizacion->id_vuelo = $datos_vuelo[0]["id_vuelo"];
$vuelo_cotizacion->id_unidad = $datos_vuelo[0]["id_unidad"];
$vuelo_cotizacion->cantidades = $pasajeros;
$vuelo_cotizacion->precio_vendido_p_pax_vuelo = $total;
$vuelo_cotizacion->precio_especial = 0;
$vuelo_cotizacion->id_cotizacion = $folio_cotizaciones["id_cotizacion"];
$vuelo_cotizacion->pasajero_adicional = 0;
$vuelo_cotizacion->id_estatus = 1;
$vuelo_cotizacion->id_user_alta = 98;
$vuelo_cotizacion->fecha_alta = Carbon::now();
$vuelo_cotizacion->save();
return response()->json([
"exito" => 1
]);
} catch (Exception $e) {
return response()->json([
"exito" => 0,
"error" => $e->getMessage()
]);
}
}
public static function obtenerServiciosAdicionales()
{
try {
$response = Http::timeout(10)->get(
'https://erp.skyballoons.mx/servicios-adicionales-webservice',
[
'comercio' => 'skyballoons',
'key' => 'f093328776ae4cd210dc7b4ee4093e45'
]
);
if ($response->successful()) {
return $response->json();
}
return [];
} catch (\Exception $e) {
return [];
}
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index()
{
return view('home');
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class IdiomaController extends Controller
{
/**
* Summary of cambiarIdioma
* @param Request $request
* @param mixed $locale
* @return \Illuminate\Http\RedirectResponse
*/
public function cambiarIdioma(Request $request, $locale = 'es')
{
if (in_array($locale, ['es', 'en'])) {
session(['locale' => $locale]);
app()->setLocale($locale);
}
return redirect()->back();
}
}

View File

@ -0,0 +1,227 @@
<?php
namespace App\Http\Controllers\Page;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
class TelegramController extends Controller
{
public ?string $token = null;
public ?string $baseUrl = null;
public function __construct()
{
// Token de prueba (recuerda revocarlo después)
$this->token = '8617998449:AAFK4DNGPV3efRpmcjeMVZhdTUeErGj-ePc';
$this->baseUrl = "https://api.telegram.org/bot{$this->token}";
// Si prefieres usar config (recomendado para producción)
// $this->token = config('services.telegram.token');
// $this->baseUrl = config('services.telegram.base_url') . "/bot{$this->token}";
}
/**
* Enviar texto simple
*/
public function sendText($chatId, $text, $parseMode = null)
{
$params = [
'chat_id' => $chatId,
'text' => $text,
];
if ($parseMode) {
$params['parse_mode'] = $parseMode;
}
$response = Http::post("{$this->baseUrl}/sendMessage", $params);
return $response->json();
}
/**
* Enviar mensaje con teclado personalizado
*/
public function sendKeyboard($chatId, $text, $buttons = [])
{
$keyboard = [
'keyboard' => $buttons,
'resize_keyboard' => true,
'one_time_keyboard' => false,
];
$response = Http::post("{$this->baseUrl}/sendMessage", [
'chat_id' => $chatId,
'text' => $text,
'reply_markup' => json_encode($keyboard),
]);
return $response->json();
}
/**
* Enviar botones inline
*/
public function sendInlineKeyboard($chatId, $text, $buttons = [])
{
$inlineKeyboard = [
'inline_keyboard' => $buttons,
];
$response = Http::post("{$this->baseUrl}/sendMessage", [
'chat_id' => $chatId,
'text' => $text,
'reply_markup' => json_encode($inlineKeyboard),
]);
return $response->json();
}
/**
* Webhook principal con sistema de comandos mejorado
*/
public function webhook(Request $request)
{
$update = $request->all();
Log::info('Webhook recibido', $update);
if (isset($update['message'])) {
$chatId = $update['message']['chat']['id'];
$text = trim($update['message']['text'] ?? '');
$firstName = $update['message']['from']['first_name'] ?? 'Usuario';
// Sistema de comandos
$comandos = [
'/start' => function () use ($firstName) {
return "🎈 ¡Bienvenido a SkyBalloons, {$firstName}!\n\n" . "Somos especialistas en decoración con globos para eventos.\n\n" . "🎯 Comandos disponibles:\n" . "/help - Ver ayuda\n" . "/info - Información del bot\n" . "/contacto - Contactar soporte\n" . "/precios - Solicitar precios\n" . '/eventos - Tipos de eventos';
},
'/help' => function () {
return "📖 *Comandos disponibles:*\n\n" . "/start - Iniciar el bot\n" . "/help - Mostrar esta ayuda\n" . "/info - Información del bot\n" . "/contacto - Datos de contacto\n" . "/precios - Información de precios\n" . "/eventos - Tipos de eventos que realizamos\n\n" . '💡 *Ejemplo:* Envíame un mensaje directo y te responderé.';
},
'/info' => function () {
return "🤖 *Información del Bot*\n\n" . "📌 Nombre: SkyBalloons Bot\n" . "👤 Usuario: @skyballoons_bot\n" . '📱 Framework: Laravel ' . app()->version() . "\n" . "🔄 Versión: 2.0\n" . '📅 Estado: Activo (modo prueba)';
},
'/contacto' => function () {
return "📞 *Contacto SkyBalloons*\n\n" . "📧 Email: skyballoons@ejemplo.com\n" . "📱 Telegram: @skyballoons_soporte\n" . "📷 Instagram: @skyballoons\n" . "📍 Ubicación: Ciudad de México\n\n" . '⏰ Horario: Lunes a Viernes 9am - 6pm';
},
'/precios' => function () {
return "💰 *Precios Referenciales*\n\n" . "🎈 Globo latex (docena): $120 MXN\n" . "✨ Globo metalizado (docena): $250 MXN\n" . "🎉 Arco de globos: Desde $800 MXN\n" . "🎊 Centro de mesa: Desde $350 MXN\n" . "🎈 Globos con helio (c/u): $40 MXN\n\n" . '📩 Solicita cotización personalizada con /cotizar';
},
'/eventos' => function () {
return "🎪 *Eventos que realizamos*\n\n" . "✅ Cumpleaños\n" . "✅ Bodas\n" . "✅ Baby showers\n" . "✅ Graduaciones\n" . "✅ Eventos corporativos\n" . "✅ Aniversarios\n" . "✅ Fiestas infantiles\n\n" . '¡Pide tu presupuesto sin compromiso!';
},
'/cotizar' => function () use ($chatId) {
// Aquí podrías iniciar un flujo de conversación
return "📝 *Solicitud de cotización*\n\n" . "Por favor, responde estas preguntas:\n" . "1. ¿Qué tipo de evento será?\n" . "2. ¿Cuántos invitados aproximadamente?\n" . "3. ¿Cuándo es la fecha del evento?\n" . "4. ¿Tienes algún diseño en mente?\n\n" . 'Un asesor te contactará en breve.';
},
];
// Verificar si el comando existe
if (isset($comandos[$text])) {
$respuesta = $comandos[$text]();
$this->sendText($chatId, $respuesta, 'Markdown');
}
// Responder mensajes de texto normales
else {
$respuesta = "🎈 ¡Hola {$firstName}!\n\n" . "Recibí tu mensaje: \"{$text}\"\n\n" . "Usa /help para ver todos los comandos disponibles.\n\n" . "💡 *Tips:*\n" . "• /precios - Ver lista de precios\n" . "• /eventos - Tipos de eventos\n" . '• /cotizar - Solicitar cotización';
$this->sendText($chatId, $respuesta, 'Markdown');
}
}
// Manejar callback queries (botones inline)
elseif (isset($update['callback_query'])) {
$callbackQuery = $update['callback_query'];
$chatId = $callbackQuery['message']['chat']['id'];
$data = $callbackQuery['data'];
// Responder al callback
Http::post("{$this->baseUrl}/answerCallbackQuery", [
'callback_query_id' => $callbackQuery['id'],
'text' => "Procesando: {$data}",
'show_alert' => false,
]);
// Enviar mensaje según el callback
$this->sendText($chatId, "Has seleccionado: {$data}\n\nUn asesor te contactará pronto.");
}
return response()->json(['ok' => true], 200);
}
/**
* Obtener actualizaciones manualmente (sin webhook)
*/
public function getUpdates(Request $request)
{
$offset = $request->get('offset', 0);
$limit = $request->get('limit', 100);
$timeout = $request->get('timeout', 30);
$response = Http::get("{$this->baseUrl}/getUpdates", [
'offset' => $offset,
'limit' => $limit,
'timeout' => $timeout,
]);
return response()->json($response->json());
}
/**
* Configurar webhook
*/
public function setWebhook(Request $request)
{
$url = $request->get('url');
if (!$url) {
return response()->json(['error' => 'URL requerida'], 400);
}
$response = Http::post("{$this->baseUrl}/setWebhook", [
'url' => $url,
]);
return response()->json($response->json());
}
/**
* Eliminar webhook
*/
public function deleteWebhook()
{
$response = Http::post("{$this->baseUrl}/deleteWebhook");
return response()->json($response->json());
}
/**
* Obtener información del webhook
*/
public function getWebhookInfo()
{
$response = Http::get("{$this->baseUrl}/getWebhookInfo");
return response()->json($response->json());
}
/**
* Enviar mensaje directo (endpoint para pruebas)
*/
public function sendMessage(Request $request)
{
$chatId = $request->get('chat_id', 7981938691); // Tu chat ID por defecto
$text = $request->get('text', 'Mensaje de prueba');
return response()->json($this->sendText($chatId, $text, 'Markdown'));
}
}

View File

@ -0,0 +1,412 @@
<?php
namespace App\Http\Controllers\Page;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Collection;
/**
* Class VuelosController
*
* Controlador encargado de la gestión de vuelos en la web.
*
* Funcionalidades principales:
* - Listado de vuelos visibles en la web
* - Vuelos para la página principal (home)
* - Detalle de un vuelo específico
* - Soporte multilingual (ES / EN)
* - Agregación optimizada de información relacionada:
* precios, categorías, imágenes e inclusiones
*
* Optimización:
* - Queries en bloque (evita N+1)
* - Uso de keyBy / groupBy para acceso rápido
* - Transformación centralizada de datos
*/
class VuelosController extends Controller
{
/**
* ID del sitio web actual.
*
* @var int
*/
protected int $sitio_web;
public function __construct()
{
$this->sitio_web = config('sitioweb.sitio_web_erp_id', 0);
}
/**
* Muestra el detalle de un vuelo específico.
*
* @param Request $request
* @param int $id ID del vuelo
*
* @return \Illuminate\Http\JsonResponse
*
* Respuesta:
* - 200: Objeto del vuelo
* - 404: Vuelo no encontrado
*/
public function show(Request $request, int $id)
{
$lang = $request->get('lang', 'en');
$vuelo = $this->getVuelosData(collect([$id]), $lang)->first();
if (!$vuelo) {
return response()->json(
[
'message' => 'Vuelo no encontrado',
],
404,
);
}
return response()->json($vuelo);
}
/**
* Obtiene colección de vuelos visibles en la web.
*
* @return \Illuminate\Http\JsonResponse
*/
public function getVuelosCollection()
{
return $this->buildCollectionResponse(function ($query) {
$query->where('visibilidad_pagina_web', 1);
});
}
/**
* Obtiene colección de vuelos visibles en la home.
*
* @return \Illuminate\Http\JsonResponse
*/
public function getVuelosCollectionHome()
{
return $this->buildCollectionResponse(function ($query) {
$query->where('visibilidad_pagina_web', 1)->where('show_flight_in_home_view', 0);
});
}
/**
* Builder reutilizable para colecciones de vuelos.
*
* @param callable $callback Filtros dinámicos sobre la query base
*
* @return \Illuminate\Http\JsonResponse
*/
private function buildCollectionResponse(callable $callback)
{
$lang = app()->getLocale();
$query = DB::table('vuelos')->where('id_sitio_web', $this->sitio_web)->where('id_estatus', 1);
$callback($query);
$ids = $query->pluck('id_vuelo');
return response()->json([
'vuelos' => $this->getVuelosData($ids, $lang)->values(),
]);
}
/**
* Motor principal de transformación de vuelos.
*
* @param Collection $ids IDs de vuelos
* @param string $lang Idioma actual
*
* @return Collection
*/
private function getVuelosData(Collection $ids, string $lang): Collection
{
if ($ids->isEmpty()) {
return collect();
}
$data = $this->fetchAllData($ids, $lang);
return $ids->map(fn($id) => $this->transformVuelo($id, $data, $lang))->filter();
}
/**
* Obtiene todos los datos relacionados en bloque.
*
* @param Collection $ids
* @param string $lang
*
* @return array
*/
private function fetchAllData(Collection $ids, string $lang): array
{
$vuelos = DB::table('vuelos')->whereIn('id_vuelo', $ids)->get()->keyBy('id_vuelo');
return [
'vuelos' => $vuelos,
'vuelos_en' => $lang === 'en' ? DB::table('vuelos_usd')->whereIn('id_vuelo', $ids)->get()->keyBy('id_vuelo') : collect(),
'categorias' => DB::table('categorias_vuelos')->whereIn('id_categoria', $vuelos->pluck('id_categoria'))->get()->keyBy('id_categoria'),
'precios' => DB::table('vuelos_precios')->whereIn('id_vuelo', $ids)->where('id_estatus', 1)->get()->keyBy('id_vuelo'),
'imagenes' => DB::table('vuelos_imagenes_galeria')->whereIn('id_vuelo', $ids)->where('id_estatus', 1)->orderBy('orden')->get()->groupBy('id_vuelo'),
'incluye' => DB::table('vuelos_items_incluye')->whereIn('id_vuelo', $ids)->where('id_estatus', 1)->get()->groupBy('id_vuelo'),
];
}
/**
* Transforma un vuelo a su estructura final.
*
* @param int $id
* @param array $data
* @param string $lang
*
* @return array|null
*/
private function transformVuelo(int $id, array $data, string $lang): ?array
{
$vuelo = $data['vuelos'][$id] ?? null;
if (!$vuelo) {
return null;
}
$vuelo = $this->mergeIdioma($vuelo, $data['vuelos_en'][$id] ?? null, $lang);
$vuelo = $this->normalizeVuelo($vuelo);
$categoria = $data['categorias'][$vuelo->id_categoria] ?? null;
return [
'vuelo' => $vuelo,
'categoria' => [
'nombre' => $lang === 'en' ? $categoria->nombre_categoria_usd ?? null : $categoria->nombre_categoria ?? null,
],
'precios' => $data['precios'][$id] ?? null,
'imagenes' => $data['imagenes'][$id] ?? collect(),
'incluye' => $data['incluye'][$id] ?? collect(),
];
}
/**
* Aplica traducción al vuelo si el idioma es inglés.
*
* @param mixed $vuelo
* @param mixed $vuelo_en
* @param string $lang
*
* @return mixed
*/
private function mergeIdioma($vuelo, $vuelo_en, string $lang)
{
if ($lang !== 'en' || !$vuelo_en) {
return $vuelo;
}
$map = [
'nombre_vuelo' => 'titulo_vuelo',
'descripcion_corta' => 'descripcion_corta',
'descripcion_larga' => 'descripcion_larga',
'json_incluye' => 'json_incluye',
'servicios_adicionales' => 'servicios_adicionales',
'precio_publico' => 'precio_usd',
'precio_especial' => 'precio_especial_usd',
];
foreach ($map as $target => $source) {
if (isset($vuelo_en->$source)) {
$vuelo->$target = $vuelo_en->$source;
}
}
return $vuelo;
}
/**
* Normaliza campos JSON del vuelo.
*
* @param mixed $vuelo
*
* @return mixed
*/
private function normalizeVuelo($vuelo)
{
$vuelo->json_incluye = $this->safeJsonDecode($vuelo->json_incluye);
$vuelo->precios_adicionales = $this->safeJsonDecode($vuelo->precios_adicionales);
return $vuelo;
}
/**
* Decodifica JSON de forma segura.
*
* @param mixed $value
*
* @return array
*/
private function safeJsonDecode($value)
{
if (!$value || $value === 'null') {
return [];
}
return json_decode($value, true) ?? [];
}
public static function obtenerServiciosAdicionales()
{
return DB::table('servicios_adicionales as sa')
->leftJoin('unidades as u', 'u.id_unidad', '=', 'sa.id_unidad')
->leftJoin('categorias as c', 'c.id_categoria', '=', 'sa.additional_service_category_id')
->select(
DB::raw('COALESCE(c.nombre_categoria, "Sin categoría") as nombre_categoria'),
DB::raw("
JSON_ARRAYAGG(
JSON_OBJECT(
'id', sa.id_servicio_adicional,
'descripcion', TRIM(sa.descripcion),
'precio', CAST(sa.precio AS DECIMAL(10,2)),
'observaciones', TRIM(sa.observaciones),
'unidad', u.nombre_unidad,
'imagenes', COALESCE((
SELECT JSON_ARRAYAGG(
JSON_UNQUOTE(
JSON_EXTRACT(sag2.json_rutas_imagenes, '$[0]')
)
)
FROM servicios_adicionales_galeria sag2
WHERE sag2.id_servicio_adicional = sa.id_servicio_adicional
AND sag2.id_estatus = 1
), JSON_ARRAY())
)
) as servicios
"),
)
->where('sa.id_estatus', 1)
->where('sa.visibilidad_web', 1)
->groupBy('nombre_categoria')
->orderBy('nombre_categoria') // ordena categorías
->get()
->map(function ($item) {
return [
'nombre_categoria' => $item->nombre_categoria,
'servicios' => json_decode($item->servicios, true), // 🔥 JSON → array real
];
})
->values();
}
/**
* Busca el ID del vuelo a partir del slug (multilenguaje).
*
* @param string $slug
* @param string $lang
* @return int|null
*/
private function findVueloIdBySlug(string $slug, string $lang): ?int
{
// Buscar en tabla base (ES)
$query = DB::table('vuelos')->where('id_sitio_web', $this->sitio_web)->where('id_estatus', 1);
if ($lang === 'en') {
// Buscar en tabla traducida
return DB::table('vuelos_usd')->where('slug', $slug)->value('id_vuelo');
}
return $query->where('slug', $slug)->value('id_vuelo');
}
/**
* Muestra el detalle de un vuelo por su enlace_permanente (slug permanente)
*
* Usa el idioma actual de la aplicación (sesión)
*
* @param Request $request
* @param string $enlace_permanente
* @return \Illuminate\Http\JsonResponse
*/
public function showByPermanentLink(Request $request, string $enlace_permanente)
{
$lang = app()->getLocale(); // 'es' o 'en'
$id = $this->findVueloIdByPermanentLink($enlace_permanente, $lang);
if (!$id) {
return response()->json([
'message' => $lang === 'en'
? 'Flight not found'
: 'Vuelo no encontrado'
], 404);
}
$vuelo = $this->getVuelosData(collect([$id]), $lang)->first();
if (!$vuelo) {
return response()->json([
'message' => $lang === 'en'
? 'Flight not found'
: 'Vuelo no encontrado'
], 404);
}
return response()->json($vuelo);
}
/**
* Busca el ID del vuelo a partir del enlace permanente (slug canónico).
*
* @param string $enlace_permanente
* @param string $lang
* @return int|null
*/
private function findVueloIdByPermanentLink(string $enlace_permanente, string $lang): ?int
{
// Siempre buscar primero en la tabla base (canónica)
$id = DB::table('vuelos')
->where('id_sitio_web', $this->sitio_web)
->where('id_estatus', 1)
->where('enlace_permanente', $enlace_permanente)
->value('id_vuelo');
if ($id) {
return $id;
}
// Fallback opcional: si estás en inglés y existe en tabla traducida
if ($lang === 'en') {
return DB::table('vuelos_usd')
->where('enlace_permanente', $enlace_permanente)
->value('id_vuelo');
}
return null;
}
public function getVuelosFoot()
{
}
public static function cotizaVuelo($slug, Request $request)
{
//Insertar en NNewsletter
\Log::info('Cotización recibida:', $request->all());
// return $request;
DB::table('newsletter_skyballoons')->insert([
'correo_electronico' => $request->email,
'origin_url' => 'https://' . DB::table('sitios_web')->where('id_sitio_web', 2)->value('url_web'),
'id_sitio_web' => 2,
'fecha_alta' => now(),
]);
}
}

View File

@ -0,0 +1,485 @@
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Api\TelegramController;
use App\Http\Controllers\Page\VuelosController;
use Artesaos\SEOTools\Facades\SEOTools;
use DB;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
use Symfony\Component\HttpFoundation\Request;
use Illuminate\Support\Facades\Validator;
class PagesController extends Controller
{
public $objVueloController;
public $telegramObject;
public function __construct()
{
$this->objVueloController = new VuelosController();
$this->telegramObject = new TelegramController();
}
//pagina de inicio
public function index()
{
// SEO mejorado para vueloenglobo.mx
SEOTools::setTitle('Vuelos en globo - vueloenglobo.mx | Experiencias en Teotihuacán');
SEOTools::setDescription('Reserva vuelos en globo sobre Teotihuacán. Experiencias seguras, guías expertos y las mejores vistas al mejor precio. Reserva online en VueloEnGlobo.mx.');
SEOTools::metatags()->setKeywords(['vuelos en globo', 'vuelo en globo teotihuacan', 'vuelos baratos', 'experiencias en globo', 'reservar vuelo en globo']);
SEOTools::setCanonical('https://vueloenglobo.mx/');
SEOTools::opengraph()->addProperty('type', 'website');
//$vuelos = EsConsultasController::getVueloCompleto();
$response = $this->objVueloController->getVuelosCollectionHome();
$data = $response->getData(true);
$vuelos = $data['vuelos'];
//return $vuelos;
return view('template.home', compact('vuelos'));
}
/**
* Método que me carga y agrupa los vuelos disponibles por categoría
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View
*/
public function vuelosEnGlobo()
{
$vuelos = $this->agruparVuelosListado($this->objVueloController->getVuelosCollection());
return view('template.vuelos-en-globo', compact('vuelos'));
}
/**
* Método que agrupar por categoría los vuelos en globo
* @param mixed $listadoVuelos
* @return array<array>
*/
private function agruparVuelosListado($listadoVuelos)
{
$data = $listadoVuelos->getData(true);
$agrupados = [];
foreach ($data['vuelos'] as $item) {
$categoria = $item['categoria']['nombre'] ?? 'Sin categoría';
if (!isset($agrupados[$categoria])) {
$agrupados[$categoria] = [];
}
$agrupados[$categoria][] = $item;
}
return $agrupados;
}
public function vuelosEnGloboCopy()
{
$vuelos = EsConsultasController::getVueloCompleto();
// return $vuelos;
return view('template.vuelos-en-globo', compact('vuelos'));
}
public function vueloSeleccionado(Request $request, $vuelo)
{
$objClase = new VuelosController();
$response = $objClase->showByPermanentLink($request, $vuelo);
$datosVuelo = $response->getData(true);
return view('template.vuelo-seleccionado', compact('datosVuelo'));
}
// public function vueloSeleccionado($vuelo)
// {
// $datosVuelo = EsConsultasController::getInfoVuelo($vuelo);
// return view('template.vuelo-seleccionado', compact('datosVuelo'));
// }
public function realizaPago($vuelo)
{
$datosVuelo = EsConsultasController::getInfoVuelo($vuelo);
$adicionales = EsConsultasController::obtenerServiciosAdicionales();
//return $adicionales;
return view('template.checkout', compact('datosVuelo', 'adicionales'));
}
//esta pendiente
public function vueloSeleccionado2($vuelo)
{
$datos_vuelo = EsConsultasController::getDatosVuelo($vuelo);
if (!$datos_vuelo) {
abort(404);
}
// return $datos_vuelo;
return view('template.vuelo-seleccionado', [
'datos_vuelo' => $datos_vuelo,
'incluye' => json_decode($datos_vuelo->json_incluye ?? '[]', true) ?: [],
'adicionales' => json_decode($datos_vuelo->precios_adicionales ?? '[]', true) ?: [],
]);
}
// pagina de contacto
public function contacto()
{
return view('template.contacto');
}
// pagina de servicios
public function servicios()
{
return view('template.servicios');
}
// pagina de nosotros
public function nosotros()
{
return view('template.nosotros');
}
// pagina de preguntas frecuentes
public function preguntasFrecuentes()
{
return view('template.preguntasFrecuentes');
}
// pagina de terminos y condiciones
public function terminosCondiciones()
{
return view('template.terminosCondiciones');
}
public function cotizarVuelo($slug, Request $request)
{
//obtener el vuelo
$vuelo = DB::table('vuelos')->where('id_vuelo', $request->id_vuelo)->first();
$partes = explode(' ', $request->nombre);
$nombres = implode(' ', array_slice($partes, 0, -2));
$apellidoPaterno = $partes[count($partes) - 2];
$apellidoMaterno = end($partes);
CotizacionController::crearCotizacionYPosibleCompraErp([
'nombre' => $nombres,
'apellidos' => $apellidoPaterno . ' ' . $apellidoMaterno,
'email' => $request->email,
'telefono' => $request->telefono,
'total_compra' => $vuelo->precio_publico * $request->pasajeros,
'total_a_pagar' => $vuelo->precio_publico * $request->pasajeros,
]);
PagesController::sendTelegramMessage('se cotizo un vuelo: ' . $request->nombre_vuelo . ' a nombre de: ' . $request->nombre . '. mas información consultarla en el ERP');
$response = VuelosController::cotizaVuelo($slug, $request);
return json_encode(['mesaaje' => 'Se cotizo el vuelo exitosamente']);
}
private static function sendTelegramMessage($message)
{
$botToken = '8617998449:AAFK4DNGPV3efRpmcjeMVZhdTUeErGj-ePc';
$chatId = '8446032916';
Http::post("https://api.telegram.org/bot{$botToken}/sendMessage", [
'chat_id' => $chatId,
'text' => $message,
]);
}
/**
* Método que se muestra al cliente para completar el proceso de su
* @param mixed $slug
* @param Request $request
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View
*/
public function reservarVueloAhora($slug = null, Request $request)
{
$objClase = new VuelosController();
$response = $objClase->showByPermanentLink($request, $slug);
$datosVuelo = $response->getData(true);
$adicionales = $this->getServiciosAdicionales();
SEOTools::setTitle($datosVuelo['vuelo']['nombre_vuelo'] . ' | www.vueloenglobo.mx');
SEOTools::setDescription($datosVuelo['vuelo']['descripcion_corta']);
SEOTools::metatags()->setKeywords(['vuelos', 'vuelos baratos', 'ofertas']);
return view('template.checkout', compact('datosVuelo', 'adicionales'));
}
/**
* Obtiene y transforma los servicios adicionales desde la API externa
*
* @return array Array de categorías con sus servicios
*/
private function getServiciosAdicionales(): array
{
try {
$response = Http::get('https://erp.skyballoons.mx/servicios-adicionales-webservice', [
'comercio' => 'skyballoons',
'key' => 'f093328776ae4cd210dc7b4ee4093e45',
]);
if (!$response->successful()) {
return [];
}
$datos = $response->json();
if (!is_array($datos) || empty($datos)) {
return [];
}
// Transformar al formato de categorías (una sola categoría por simplicidad)
$servicios = array_map(function ($item) {
return [
'id' => $item['id_servicio_adicional'] ?? null,
'descripcion' => $item['nombre'] ?? 'Servicio',
'precio' => (float) ($item['precio'] ?? 0),
'precio_dolares' => (float) ($item['precio_dolares'] ?? 0),
'imagenes' => $item['galeria'] ?? [],
'observaciones' => $item['descripcion'] ?? '',
];
}, $datos);
return [
[
'nombre_categoria' => 'Servicios adicionales',
'servicios' => array_filter($servicios, fn($s) => !is_null($s['id'])),
],
];
} catch (\Exception $e) {
\Log::error('Error al obtener servicios adicionales: ' . $e->getMessage());
return [];
}
}
public function getNombresDeVuelos()
{
$vuelos = $this->agruparVuelosListado($this->objVueloController->getVuelosCollection());
return collect($vuelos)->map(function ($items) {
return collect($items)
->map(function ($item) {
return [
'nombre_vuelo' => $item['vuelo']['nombre_vuelo'] ?? null,
'enlace_permanente' => $item['vuelo']['enlace_permanente'] ?? null,
];
})
->values();
});
}
public function procesarR(Request $request)
{
try {
Log::info('Procesando pago', $request->all());
$payload = [
'amount' => (float) $request->input('total'),
'currency' => 'MXN',
'description' => $request->input('payment_description', 'Vuelo en Globo'),
'payment_method' => [
'token' => $request->input('card_token'),
],
'customer' => [
'email' => $request->input('payment_email'),
'phone' => preg_replace('/[^0-9]/', '', $request->input('payment_phone')),
],
];
$response = Http::withHeaders([
'Authorization' => 'Bearer ' . config('clip.api_key'),
'Content-Type' => 'application/json',
])->post(config('clip.payments_url'), $payload);
\Log::info('Respuesta Clip', ['status' => $response->status(), 'body' => $response->body()]);
if ($response->successful()) {
$paymentData = $response->json();
$paymentStatus = $paymentData['status'] ?? 'pending';
$paymentMessage = $paymentData['message'] ?? 'Pago procesado exitosamente';
if ($paymentStatus == 'approved') {
PagesController::sendTelegramMessage('Se realizó compra de vuelo en globo. ID: ' . ($paymentData['id'] ?? 'N/A'));
}
return response()->json(
[
'success' => true,
'payment_status' => $paymentStatus,
'payment_message' => $paymentMessage,
'redirect' => '#', // route('gracias')
'data' => $paymentData,
],
200,
);
} else {
$errorBody = $response->json();
// Motivo de rechazo que viene de Clip (ajusta el campo según la documentación real)
$reason = $errorBody['reason'] ?? ($errorBody['error_code']['reason'] ?? ($errorBody['rejection_reason'] ?? ''));
// Mapa de motivos de rechazo a mensajes en español
$reasonMessages = [
'not_sufficient_funds' => 'Fondos insuficientes en la tarjeta.',
'Not sufficient funds' => 'Fondos insuficientes en la tarjeta.',
'do_not_honor' => 'El banco emisor rechazó la transacción (Do not honor).',
'Do not honor' => 'El banco emisor rechazó la transacción.',
'restricted_card' => 'La tarjeta está restringida y no puede usarse.',
'Restricted card' => 'Tarjeta restringida.',
'exceeds_withdrawal_amount_limit' => 'La transacción excede el límite de retiro de esta tarjeta.',
'Exceeds withdrawal amount limit' => 'Excede el límite de retiro permitido.',
];
// Si hay un motivo conocido, usamos el mensaje traducido; si no, el mensaje original
if ($reason && isset($reasonMessages[$reason])) {
$errorMessage = $reasonMessages[$reason];
} else {
$errorMessage = $errorBody['detail'] ?? ($errorBody['error_code']['message'] ?? ($errorBody['message'] ?? 'Error al procesar el pago'));
}
PagesController::sendTelegramMessage('Error en compra: ' . $errorMessage);
return response()->json(
[
'success' => false,
'message' => $errorMessage,
'payment_status' => 'rejected',
'code' => $errorBody['error_code'] ?? null,
'reason' => $reason ?: null,
],
$response->status(),
);
}
} catch (\Exception $e) {
\Log::error('Error en procesar pago: ' . $e->getMessage(), [
'trace' => $e->getTraceAsString(),
]);
PagesController::sendTelegramMessage('Error en compra: ');
return response()->json(
[
'success' => false,
'message' => 'Error interno del servidor. Por favor intenta de nuevo.',
'payment_status' => 'error',
],
500,
);
}
}
public function procesar(Request $request)
{
// 1. Validación del payload real que envías desde frontend
// $validated = $request->validate([
// 'payment_email' => 'required|email',
// 'payment_phone' => 'required|string',
// 'payment_description' => 'nullable|string|max:255',
// 'card_token' => 'required|string',
// 'total' => 'required|numeric',
// // datos del vuelo / reserva
// 'id_vuelo' => 'required|integer',
// 'adultos' => 'nullable|integer',
// 'ninios' => 'nullable|integer',
// 'fecha' => 'nullable|date',
// 'cupon' => 'nullable|string',
// ]);
$validated = $request->all(); // Elimina esta línea y descomenta la validación real cuando estés listo para validar los datos de entrada
// 2. API Key
$apiKey = config('clip.api_key');
if (empty($apiKey)) {
Log::error('Clip API Key no configurada');
return response()->json([
'success' => false,
'message' => 'Error de configuración del servidor de pagos.',
], 500);
}
// 3. Payload oficial Clip
$payload = [
"amount" => (float) $validated['total'],
"currency" => "MXN",
"description" => $validated['payment_description'] ?? 'Vuelo en Globo Zero',
"payment_method" => [
"token" => $validated['card_token']
],
"customer" => [
"email" => $validated['payment_email'],
"phone" => $validated['payment_phone'],
],
"metadata" => [
"id_vuelo" => $validated['id_vuelo'],
"adultos" => $validated['adultos'] ?? 0,
"ninios" => $validated['ninios'] ?? 0,
"fecha" => $validated['fecha'],
]
];
try {
// 4. Petición a Clip
$response = Http::withHeaders([
"Content-Type" => "application/json",
"Authorization" => "Bearer " . $apiKey,
])->post("https://api.payclip.com/payments", $payload);
$body = $response->json();
Log::info('Respuesta Clip:', [
'status' => $response->status(),
'body' => $body
]);
// 5. Respuesta HTTP inválida
if (!$response->successful()) {
return response()->json([
'success' => false,
'message' => $body['message'] ?? 'Error al procesar pago con Clip',
'error' => $body
], $response->status());
}
// 6. Estado del pago
$status = strtolower($body['status'] ?? '');
if (in_array($status, ['approved', 'paid'])) {
// 7. AQUÍ YA PUEDES GUARDAR LA RESERVA
// Reserva::create([...]);
return response()->json([
'success' => true,
'payment_id' => $body['id'] ?? null,
'payment_status' => $status,
'message' => 'Pago aprobado correctamente',
]);
}
if (in_array($status, ['declined'])) {
return response()->json([
'success' => false,
'payment_status' => $status,
'message' => 'Pago rechazado por el banco.',
], 422);
}
return response()->json([
'success' => false,
'payment_status' => $status,
'message' => 'Estado de pago: ' . $status,
], 422);
} catch (\Exception $e) {
Log::error('Error Clip: ' . $e->getMessage());
return response()->json([
'success' => false,
'message' => 'Error de conexión con el proveedor de pagos.',
], 500);
}
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Http\Controllers\Pagina;
use App\Http\Controllers\Api\TelegramController;
use App\Http\Controllers\Controller;
use Artesaos\SEOTools\Facades\SEOTools;
use Illuminate\Http\Request;
class SitioWebController extends Controller
{
public $telegramObject;
public function __construct()
{
$this->telegramObject = new TelegramController();
}
private function getSeoIndex(){
SEOTools::setTitle('Vuelos en globo - vueloenglobo.mx | Experiencias en Teotihuacán');
SEOTools::setDescription('Reserva vuelos en globo sobre Teotihuacán. Experiencias seguras, guías expertos y las mejores vistas al mejor precio. Reserva online en VueloEnGlobo.mx.');
SEOTools::metatags()->setKeywords(['vuelos en globo', 'vuelo en globo teotihuacan', 'vuelos baratos', 'experiencias en globo', 'reservar vuelo en globo']);
SEOTools::setCanonical('https://vueloenglobo.mx/');
SEOTools::opengraph()->addProperty('type', 'website');
}
public function index()
{
$this->getSeoIndex();
return view('pagina.index');
}
}

View File

@ -0,0 +1,611 @@
<?php
namespace App\Http\Controllers;
use Picqer\Barcode\BarcodeGeneratorPNG;
use Barryvdh\DomPDF\Facade\Pdf;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Validator;
use Carbon\Carbon;
class PaseAbordarController extends Controller
{
public function crearCotizacionDesdePagoExitoso($montoPagado = null, $metodoPago = 'card')
{
$reserva = session()->get('reserva_pendiente');
if (!$reserva) {
return response()->json(['error' => 'No hay reserva pendiente'], 400);
}
$id_cotizacion = $reserva['id_cotizacion'];
$folio = $reserva['folio'];
$datos = $reserva['datos'];
// Si no se pasó el monto pagado, usar el total de la compra
if ($montoPagado === null) {
$montoPagado = $datos['total_compra'];
}
DB::beginTransaction();
try {
// 1. Insertar en la tabla cotizaciones
$fecha_vuelo = isset($datos['fecha_vuelo'])
? Carbon::createFromFormat('m/d/Y', $datos['fecha_vuelo'])->format('Y-m-d')
: null;
// Construir el JSON de vuelos (exactamente como lo hacías con modelos)
$vuelos_field = [
[
'moneda' => 'MXN',
'precio_vendido_p_pax_vuelo' => $datos['precio_publico'],
'id_vuelo' => $datos['id_vuelo'],
'id_unidad' => $datos['id_unidad'],
'cantidades' => $datos['pasajeros'],
'precio_especial' => '0'
]
];
if (!empty($datos['num_pax_adicionales']) && $datos['num_pax_adicionales'] > 0) {
$vuelos_field[0]['pasajeros_adicionales'] = [
[
'moneda' => 'MXN',
'cantidades' => $datos['num_pax_adicionales'],
'id_unidad' => $datos['id_unidad_adicionales'],
'precio' => $datos['precio_adicional'],
'precio_especial' => $datos['precio_adicional']
]
];
}
DB::table('cotizaciones')->insert([
'id_sitio_web' => 6,
'cotizacion_abierta' => isset($datos['fecha_libre']) ? 1 : 0,
'folio' => $folio,
'nombre' => $datos['nombre_reserva'],
'apellidos' => $datos['apellido_reserva'],
'id_medio_contacto' => 12,
'id_genero' => 1,
'telefono' => $datos['tel_reserva'],
'iso_country_id_primary_phone' => $datos['Lada'],
'celular' => $datos['tel_reserva'],
'iso_country_id_secondary_phone' => $datos['Lada'],
'cp' => 0,
'mail' => $datos['email_reserva'],
'fecha_vuelo' => $fecha_vuelo,
'vuelos' => json_encode($vuelos_field),
'servicios_adicionales' => $datos['servicios_adicionales'],
'tipo_descuento' => null,
'descuento' => null,
'descuento_usd' => null,
'subtotal' => $datos['total_compra'],
'total' => $datos['total_compra'],
'total_con_iva' => $datos['total_compra'],
'subtotal_usd' => 0,
'total_usd' => 0,
'tipo_cargo' => 0,
'total_cargos' => 0,
'requiere_factura' => 0,
'observaciones' => 'checkout Globopuerto Teotihuacan',
'id_motivo' => 1,
'tipo_moneda' => 'MXN',
'pais_persona' => 484,
'estado_persona' => 1,
'id_user_alta' => 98,
'peso_kg' => 0,
'number_of_pax' => $this->getNumberOfPaxes(
$vuelos_field,
$vuelos_field[0]['pasajeros_adicionales'] ?? [],
$datos['id_vuelo']
),
'fecha_alta' => Carbon::now(),
]);
// 2. Insertar vuelos_cotizaciones (vuelo principal)
DB::table('vuelos_cotizaciones')->insert([
'id_vuelo' => $datos['id_vuelo'],
'id_unidad' => $datos['id_unidad'],
'cantidades' => $datos['pasajeros'],
'precio_vendido_p_pax_vuelo' => $datos['precio_publico'],
'precio_vendido_p_pax_usd' => 0,
'precio_especial' => $datos['precio_publico'],
'id_cotizacion' => $id_cotizacion,
'pasajero_adicional' => 0,
'id_estatus' => 1,
'id_user_alta' => 98,
'fecha_alta' => Carbon::now(),
]);
// 3. Insertar vuelos_cotizaciones adicionales (si existen)
if (!empty($datos['num_pax_adicionales']) && $datos['num_pax_adicionales'] > 0) {
DB::table('vuelos_cotizaciones')->insert([
'id_vuelo' => $datos['id_vuelo'],
'id_unidad' => $datos['id_unidad_adicionales'],
'cantidades' => $datos['num_pax_adicionales'],
'precio_vendido_p_pax_vuelo' => $datos['precio_adicional'],
'precio_vendido_p_pax_usd' => 0,
'precio_especial' => $datos['precio_adicional'],
'id_cotizacion' => $id_cotizacion,
'pasajero_adicional' => 1,
'id_estatus' => 1,
'id_user_alta' => 98,
'id_user_mod' => 98,
'fecha_alta' => Carbon::now(),
'fecha_mod' => Carbon::now(),
]);
}
// 4. Insertar servicios_adicionales_cotizaciones
if (!empty($datos['servicios_adicionales'])) {
$servicios = json_decode($datos['servicios_adicionales'], true);
foreach ($servicios as $servicio) {
DB::table('servicios_adicionales_cotizaciones')->insert([
'id_servicio_adicional' => $servicio['id_servicio'],
'cantidades' => $servicio['cantidad_solicitada'],
'id_unidad' => $servicio['id_unidad'],
'precio_vendido' => $servicio['precio'],
'precio_vendido_usd' => 0,
'id_cotizacion' => $id_cotizacion,
'id_estatus' => 1,
'id_user_alta' => 88,
'fecha_alta' => Carbon::now(),
]);
}
}
// 5. Insertar el pago llamando al procedimiento almacenado (usando DB::statement)
$params_pago = [
'hora_cita' => $datos['hora_cita'],
'id_cotizacion' => $id_cotizacion,
'foto_comprobante' => null,
'cantidad_pagada' => $montoPagado,
'cantidad_pagada_usd' => 0,
'pago_confirmado_default' => 1,
'fecha_pago' => Carbon::now()->toDateString(),
'observaciones' => 'Pago exitoso desde checkout',
'observaciones_logistica' => 'Pago exitoso',
'ultimos_digitos' => null,
'id_cuenta_bancaria' => 0,
'id_metodo_pago_cuenta_bancaria' => ($metodoPago == 'card' ? 6 : ($metodoPago == 'oxxo' ? 8 : 9)),
'id_banco' => ($metodoPago == 'card' ? 11 : ($metodoPago == 'oxxo' ? 12 : 2)),
'id_user_alta' => 98,
'fecha_alta' => Carbon::now(),
'crear_pase' => 1,
'id_lugar_cita' => $datos['id_lugar_cita'],
'generar_pase_ingles' => 0,
];
// Llamar al procedimiento almacenado sp_crear_pagos_reservacion
DB::statement('CALL sp_crear_pagos_reservacion(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)', [
$params_pago['hora_cita'],
$params_pago['id_cotizacion'],
$params_pago['foto_comprobante'],
$params_pago['cantidad_pagada'],
$params_pago['cantidad_pagada_usd'],
$params_pago['pago_confirmado_default'],
$params_pago['fecha_pago'],
$params_pago['observaciones'],
$params_pago['observaciones_logistica'],
$params_pago['ultimos_digitos'],
$params_pago['id_cuenta_bancaria'],
$params_pago['id_metodo_pago_cuenta_bancaria'],
$params_pago['id_banco'],
$params_pago['id_user_alta'],
$params_pago['fecha_alta'],
$params_pago['crear_pase'],
$params_pago['id_lugar_cita'],
$params_pago['generar_pase_ingles'],
]);
// 6. Enviar el pase (opcional, pero mantén la llamada a la API)
//$url_mail = "https://erp.skyballoons.mx/enviar-pase/6/" . $id_cotizacion;
//file_get_contents($url_mail); // o usar Http::get si prefieres
DB::commit();
// Limpiar la sesión para que no se pueda reutilizar
session()->forget('reserva_pendiente');
return response()->json([
'exito' => 1,
'id_cotizacion' => $id_cotizacion,
'folio' => $folio
]);
} catch (\Exception $e) {
DB::rollBack();
return response()->json([
'exito' => 0,
'error' => $e->getMessage()
], 500);
}
}
public function guardarPosibleCompra(Request $request)
{
$datos = $request->all();
// Generar un ID de cotización (solo numérico, aún no se inserta)
$id_cotizacion = DB::table('cotizaciones')->max('id_cotizacion') + 1;
$folio = 'COT' . str_pad($id_cotizacion, 7, '0', STR_PAD_LEFT);
// Guardar en posibles_compras (solo lo que tiene la tabla)
DB::table('posibles_compras')->insert([
'id_cotizacion' => $id_cotizacion,
'id_sitio_web' => 6,
'total_reservado' => $datos['total_compra'],
'total_reserva' => $datos['total_compra'],
'fecha_alta' => Carbon::now(),
]);
// Guardar TODOS los datos de la reserva en sesión (no en BD)
session()->put('reserva_pendiente', [
'id_cotizacion' => $id_cotizacion,
'folio' => $folio,
'datos' => $datos,
]);
return response()->json([
'exito' => 1,
'id_cotizacion' => $id_cotizacion
]);
}
//
/*
public function imprimirPaseAbordar(Request $request)
{
// dd($request->all());
$generator = new BarcodeGeneratorPNG();
$barcodeBase64 = base64_encode(
$generator->getBarcode('VG1025TEO2026', $generator::TYPE_CODE_128)
);
$barcodeImg = 'data:image/png;base64,' . $barcodeBase64;
$logo = public_path('assets/img/vueloenglobo/logo-vueloenglobo.png');
$html = '
<h1>Pase de Abordar</h1>
<p>PASE DE ABORDAR</p>
';
$data = [
'pasajero' => 'JAVIER ALONSO',
'fecha' => '25 MAY 2026',
'hora' => '05:30',
'zona' => 'SKY 01',
'folio' => 'VG1025',
'barcode' => $barcodeImg,
'logo' => $logo,
];
$pdf = Pdf::loadView('pdf.pases.pase-abordar', $data)->setPaper('letter', 'portrait');
return response()->streamDownload(fn() => print $pdf->output(), 'pase-de-abordar.pdf');
} */
public function imprimirPaseAbordar(Request $request)
{
// Log para ver qué está llegando (para debug)
\Log::info('Datos recibidos en imprimirPaseAbordar:', $request->all());
// Validación de los datos principales
$validated = $request->validate([
'reservation_id' => 'required',
'id_vuelo' => 'required|integer',
'vuelo_nombre' => 'nullable|string',
'vuelo_descripcion' => 'nullable|string',
'vuelo_hora' => 'nullable|string',
'fecha_vuelo' => 'nullable|string',
'fecha_libre' => 'boolean',
'adultos' => 'required|integer|min:1',
'ninios' => 'required|integer|min:0',
'responsable' => 'required|array',
'responsable.nombres' => 'required|string',
'responsable.apellidos' => 'required|string',
'responsable.email' => 'required|email',
'responsable.telefono' => 'required|string',
'pasajeros' => 'required|array|min:1',
'pasajeros.*.nombres' => 'required|string',
'pasajeros.*.apellidos' => 'required|string',
'pasajeros.*.fecha_nacimiento' => 'required|date',
'pasajeros.*.peso_kg' => 'required|numeric',
'pasajeros.*.tipo' => 'required|string|in:adulto,nino',
'servicios' => 'nullable|array',
'servicios.*.id' => 'required|integer',
'servicios.*.cantidad' => 'required|integer|min:1',
'servicios.*.precio' => 'required|numeric',
'servicios.*.descripcion' => 'nullable|string',
'subtotal_vuelo' => 'required|numeric',
'total_extras' => 'required|numeric',
'descuento' => 'nullable|numeric',
'total' => 'required|numeric',
'payment_email' => 'nullable|email',
'payment_phone' => 'nullable|string',
'payment_description' => 'nullable|string',
'moneda' => 'nullable|string',
'simbolo' => 'nullable|string',
'categoria' => 'nullable|string',
'incluye' => 'nullable|array',
'rating' => 'nullable|numeric',
'highlighted_text' => 'nullable|string',
'highlighted_bg_color' => 'nullable|string',
]);
try {
// Generar código de barras único
$generator = new BarcodeGeneratorPNG();
$barcodeNumber = $request->reservation_id . rand(1000, 9999);
$barcodeBase64 = base64_encode($generator->getBarcode($barcodeNumber, $generator::TYPE_CODE_128));
$barcodeImg = 'data:image/png;base64,' . $barcodeBase64;
// Logo en Base64
$logoPath = public_path('assets/img/vueloenglobo/logo-vueloenglobo.png');
$logoBase64 = '';
if (file_exists($logoPath)) {
$logoData = base64_encode(file_get_contents($logoPath));
$logoBase64 = 'data:image/png;base64,' . $logoData;
} else {
// Logo por defecto si no existe
$logoBase64 = 'https://placehold.co/60x60/4A63D2/white?text=SB';
}
// Obtener los pasajeros
$pasajeros = $request->pasajeros;
$pasajeroPrincipal = $pasajeros[0] ?? null;
$nombrePasajero = $pasajeroPrincipal
? strtoupper(($pasajeroPrincipal['nombres'] ?? '') . ' ' . ($pasajeroPrincipal['apellidos'] ?? ''))
: 'PASAJERO NO ESPECIFICADO';
// Formatear la fecha del vuelo - CORREGIDO
$fechaVueloFormateada = $request->fecha_vuelo;
if ($request->fecha_libre) {
$fechaVueloFormateada = 'POR CONFIRMAR';
} elseif ($fechaVueloFormateada) {
try {
// Intentar parsear fecha en formato dd/mm/YYYY
if (preg_match('/^\d{2}\/\d{2}\/\d{4}$/', $fechaVueloFormateada)) {
$fechaCarbon = \Carbon\Carbon::createFromFormat('d/m/Y', $fechaVueloFormateada);
$fechaVueloFormateada = $fechaCarbon->format('d/m/Y');
}
// Intentar parsear fecha en formato YYYY-mm-dd
elseif (preg_match('/^\d{4}-\d{2}-\d{2}$/', $fechaVueloFormateada)) {
$fechaCarbon = \Carbon\Carbon::parse($fechaVueloFormateada);
$fechaVueloFormateada = $fechaCarbon->format('d/m/Y');
}
// Intentar parsear cualquier otro formato
else {
$fechaCarbon = \Carbon\Carbon::parse($fechaVueloFormateada);
$fechaVueloFormateada = $fechaCarbon->format('d/m/Y');
}
} catch (\Exception $e) {
\Log::warning('No se pudo parsear la fecha del vuelo: ' . $fechaVueloFormateada . ' - Error: ' . $e->getMessage());
$fechaVueloFormateada = date('d/m/Y'); // Usar fecha actual como fallback
}
} else {
$fechaVueloFormateada = date('d/m/Y'); // Fecha actual si no hay fecha
}
// Formatear hora del vuelo - CORREGIDO
$horaCita = '05:30 AM';
if ($request->vuelo_hora && !empty($request->vuelo_hora)) {
try {
// Intentar parsear hora en diferentes formatos
$horaCarbon = \Carbon\Carbon::parse($request->vuelo_hora);
$horaCita = $horaCarbon->format('h:i A');
} catch (\Exception $e) {
\Log::warning('No se pudo parsear la hora del vuelo: ' . $request->vuelo_hora);
$horaCita = $request->vuelo_hora; // Usar la hora tal como viene
}
}
// Datos del vuelo
$datosVuelo = [
'nombre_vuelo' => $request->vuelo_nombre ?? 'Vuelo en Globo',
'tipo_vuelo' => $request->categoria ?? 'Compartido',
'fecha_vuelo' => $fechaVueloFormateada,
'hora_cita' => $horaCita,
'lugar_despegue' => 'SKY BALLOONS ',
'duracion' => '40 min',
'piloto' => '',
'precio_total' => $request->total ?? 0,
'anticipo' => $request->total ?? 0,
'saldo_pendiente' => 0,
'limite_pago' => date('d/m/Y', strtotime('+7 days')),
];
// Datos del responsable
$responsable = $request->responsable;
$nombreResponsable = strtoupper(
($responsable['nombres'] ?? '') . ' ' . ($responsable['apellidos'] ?? '')
);
$emailResponsable = $responsable['email'] ?? '';
$telefonoResponsable = $responsable['telefono'] ?? '';
// Procesar servicios adicionales
$serviciosAdicionales = [];
if (!empty($request->servicios)) {
foreach ($request->servicios as $servicio) {
$serviciosAdicionales[] = [
'nombre' => $servicio['descripcion'] ?? 'Servicio adicional',
'cantidad' => $servicio['cantidad'] ?? 1,
'precio_unitario' => $servicio['precio'] ?? 0,
'precio_total' => ($servicio['cantidad'] ?? 1) * ($servicio['precio'] ?? 0),
'estado' => 'Contratado',
'clase' => 'contratado',
];
}
}
// Si no hay servicios adicionales contratados, mostrar algunos por defecto
if (empty($serviciosAdicionales)) {
$serviciosAdicionales = [
[
'nombre' => 'Fotografía profesional',
'cantidad' => 1,
'precio_unitario' => 500,
'precio_total' => 500,
'estado' => 'No contratado',
'clase' => 'no-contratado',
],
[
'nombre' => 'Video recuerdo',
'cantidad' => 1,
'precio_unitario' => 0,
'precio_total' => 0,
'estado' => 'No contratado',
'clase' => 'no-contratado',
],
];
}
// Procesar lo que incluye el vuelo
$incluye = [];
if (!empty($request->incluye)) {
foreach ($request->incluye as $item) {
$incluye[] = $item['titulo_item'] ?? $item['nombre'] ?? 'Item incluido';
}
}
// Resumen de pasajeros - CORREGIDO (manejo de fechas de nacimiento)
$resumenPasajeros = [];
foreach ($pasajeros as $pasajero) {
$fechaNacimientoFormateada = 'No especificada';
if (isset($pasajero['fecha_nacimiento']) && !empty($pasajero['fecha_nacimiento'])) {
try {
// Intentar parsear fecha de nacimiento
if (preg_match('/^\d{2}\/\d{2}\/\d{4}$/', $pasajero['fecha_nacimiento'])) {
$fechaNac = \Carbon\Carbon::createFromFormat('d/m/Y', $pasajero['fecha_nacimiento']);
$fechaNacimientoFormateada = $fechaNac->format('d/m/Y');
} else {
$fechaNac = \Carbon\Carbon::parse($pasajero['fecha_nacimiento']);
$fechaNacimientoFormateada = $fechaNac->format('d/m/Y');
}
} catch (\Exception $e) {
\Log::warning('No se pudo parsear fecha de nacimiento: ' . $pasajero['fecha_nacimiento']);
$fechaNacimientoFormateada = $pasajero['fecha_nacimiento'];
}
}
$resumenPasajeros[] = [
'nombre_completo' => strtoupper(
($pasajero['nombres'] ?? '') . ' ' . ($pasajero['apellidos'] ?? '')
),
'tipo' => $pasajero['tipo'] ?? 'adulto',
'peso_kg' => $pasajero['peso_kg'] ?? 'No especificado',
'fecha_nacimiento' => $fechaNacimientoFormateada,
];
}
// Información de pago
$infoPago = [
'metodo' => 'Tarjeta de crédito/débito',
'email' => $request->payment_email ?? $emailResponsable,
'telefono' => $request->payment_phone ?? $telefonoResponsable,
'descripcion' => $request->payment_description ?? $request->vuelo_nombre ?? 'Reserva de vuelo',
'moneda' => $request->moneda ?? 'MXN',
'simbolo' => $request->simbolo ?? '$',
];
// Preparar todos los datos para la vista
$data = [
// Datos del vuelo
'nombre_vuelo' => $datosVuelo['nombre_vuelo'],
'tipo_vuelo' => $datosVuelo['tipo_vuelo'],
'fecha_vuelo' => $datosVuelo['fecha_vuelo'],
'hora_cita' => $datosVuelo['hora_cita'],
'lugar_despegue' => $datosVuelo['lugar_despegue'],
'duracion' => $datosVuelo['duracion'],
'piloto' => $datosVuelo['piloto'],
'highlighted_text' => $request->highlighted_text ?? '',
'highlighted_bg_color' => $request->highlighted_bg_color ?? '#2563eb',
'rating' => $request->rating ?? 0,
// Datos del responsable
'nombre_responsable' => $nombreResponsable,
'email_responsable' => $emailResponsable,
'telefono_responsable' => $telefonoResponsable,
// Datos de pasajeros
'nombre_pasajero' => $nombrePasajero,
'lista_pasajeros' => $pasajeros,
'resumen_pasajeros' => $resumenPasajeros,
// Totales y precios
'precio_total' => $datosVuelo['precio_total'],
'subtotal_vuelo' => $request->subtotal_vuelo ?? 0,
'total_extras' => $request->total_extras ?? 0,
'descuento' => $request->descuento ?? 0,
'anticipo' => $datosVuelo['anticipo'],
'saldo_pendiente' => $datosVuelo['saldo_pendiente'],
'limite_pago' => $datosVuelo['limite_pago'],
// Información de pago
'info_pago' => $infoPago,
// Servicios e inclusiones
'servicios_adicionales' => $serviciosAdicionales,
'incluye' => $incluye,
// Datos de la reserva
'folio_reserva' => $request->reservation_id,
'fecha_reserva' => now()->format('d/m/Y H:i:s'),
// Códigos e imágenes
'barcode' => $barcodeImg,
'barcode_number' => $barcodeNumber,
'logo' => $logoBase64,
// Datos adicionales
'adultos' => $request->adultos ?? 1,
'ninios' => $request->ninios ?? 0,
'total_pasajeros' => ($request->adultos ?? 0) + ($request->ninios ?? 0),
'vuelo_descripcion' => $request->vuelo_descripcion ?? '',
];
// Generar PDF
$pdf = Pdf::loadView('pdf.pases.pase-abordar', $data)
->setPaper('letter', 'portrait')
->setOptions([
'defaultFont' => 'sans-serif',
'isHtml5ParserEnabled' => true,
'isRemoteEnabled' => true,
'chroot' => public_path(),
]);
// Guardar una copia del PDF (opcional)
$pdfPath = storage_path('app/public/pases-abordar/');
if (!file_exists($pdfPath)) {
mkdir($pdfPath, 0755, true);
}
$pdfPathCompleto = $pdfPath . "pase_abordar_" . $request->reservation_id . "_" . date('Ymd_His') . ".pdf";
$pdf->save($pdfPathCompleto);
// Enviar correo con el pase de abordar (opcional - comentado)
try {
// Mail::to($emailResponsable)->send(new PaseAbordarMail($data, $pdf));
// \Log::info("Correo enviado a: {$emailResponsable}");
} catch (\Exception $e) {
\Log::error("Error enviando correo: " . $e->getMessage());
}
// Descargar el PDF
return $pdf->download("pase_abordar_" . $request->reservation_id . ".pdf");
} catch (\Exception $e) {
\Log::error('Error generando pase de abordar: ' . $e->getMessage());
\Log::error('Trace: ' . $e->getTraceAsString());
return response()->json([
'success' => false,
'message' => 'Error al generar el pase de abordar: ' . $e->getMessage()
], 500);
}
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
class PaymentController extends Controller
{
public function store(Request $request)
{
$validated = $request->validate([
'token' => 'required|string',
'amount' => 'required|numeric|min:0.01',
'description' => 'nullable|string|max:255',
'email' => 'required|email',
'phone' => 'required|string',
]);
$payload = [
'amount' => (float) $validated['amount'],
'currency' => 'MXN',
'description' => $validated['description'] ?? 'Pago con SDK Clip',
'payment_method' => [
'token' => $validated['token']
],
'customer' => [
'email' => $validated['email'],
'phone' => $validated['phone']
]
];
$response = Http::withHeaders([
'Authorization' => 'Bearer ' . config('clip.api_key'),
'Content-Type' => 'application/json',
])->post(config('clip.payments_url'), $payload);
if ($response->successful()) {
return response()->json($response->json(), 201);
}
return response()->json([
'error' => $response->json('detail') ?? 'Error al procesar el pago',
'code' => $response->json('error_code')
], $response->status());
}
}

98
app/Http/Kernel.php Normal file
View File

@ -0,0 +1,98 @@
<?php
namespace App\Http;
use App\Http\Middleware\Authenticate;
use App\Http\Middleware\EncryptCookies;
use App\Http\Middleware\MinifyHtml;
use App\Http\Middleware\PreventRequestsDuringMaintenance;
use App\Http\Middleware\RedirectIfAuthenticated;
use App\Http\Middleware\SetLocale;
use App\Http\Middleware\TrimStrings;
use App\Http\Middleware\TrustProxies;
use App\Http\Middleware\ValidateSignature;
use App\Http\Middleware\VerifyBearerToken;
use App\Http\Middleware\VerifyCsrfToken;
use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth;
use Illuminate\Auth\Middleware\Authorize;
use Illuminate\Auth\Middleware\EnsureEmailIsVerified;
use Illuminate\Auth\Middleware\RequirePassword;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
use Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests;
use Illuminate\Foundation\Http\Middleware\ValidatePostSize;
use Illuminate\Http\Middleware\HandleCors;
use Illuminate\Http\Middleware\SetCacheHeaders;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Routing\Middleware\ThrottleRequests;
use Illuminate\Session\Middleware\AuthenticateSession;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\View\Middleware\ShareErrorsFromSession;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array<int, class-string|string>
*/
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
TrustProxies::class,
HandleCors::class,
PreventRequestsDuringMaintenance::class,
ValidatePostSize::class,
TrimStrings::class,
ConvertEmptyStringsToNull::class,
//MinifyHtml::class,
];
/**
* The application's route middleware groups.
*
* @var array<string, array<int, class-string|string>>
*/
protected $middlewareGroups = [
'web' => [
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
SetLocale::class,
],
'api' => [
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
ThrottleRequests::class . ':api',
SubstituteBindings::class,
],
];
/**
* The application's middleware aliases.
*
* Aliases may be used instead of class names to conveniently assign middleware to routes and groups.
*
* @var array<string, class-string|string>
*/
protected $middlewareAliases = [
'auth' => Authenticate::class,
'auth.basic' => AuthenticateWithBasicAuth::class,
'auth.session' => AuthenticateSession::class,
'cache.headers' => SetCacheHeaders::class,
'can' => Authorize::class,
'guest' => RedirectIfAuthenticated::class,
'password.confirm' => RequirePassword::class,
'precognitive' => HandlePrecognitiveRequests::class,
'signed' => ValidateSignature::class,
'throttle' => ThrottleRequests::class,
'verified' => EnsureEmailIsVerified::class,
'auth.bearer' => VerifyBearerToken::class,
];
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Illuminate\Http\Request;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*/
protected function redirectTo(Request $request): ?string
{
return $request->expectsJson() ? null : route('login');
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
class EncryptCookies extends Middleware
{
/**
* The names of the cookies that should not be encrypted.
*
* @var array<int, string>
*/
protected $except = [
//
];
}

View File

@ -0,0 +1,34 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class MinifyHtml
{
public function handle($request, Closure $next)
{
$response = $next($request);
if (str_contains($response->headers->get('Content-Type'), 'text/html')) {
$content = $response->getContent();
$minify = preg_replace([
'/>\s+/s', // espacios después de tags
'/\s+</s', // espacios antes de tags
'/(\s)+/s' // múltiples espacios
], [
'>',
'<',
'\\1'
], $content);
$response->setContent($minify);
}
return $response;
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
class PreventRequestsDuringMaintenance extends Middleware
{
/**
* The URIs that should be reachable while maintenance mode is enabled.
*
* @var array<int, string>
*/
protected $except = [
//
];
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Http\Middleware;
use App\Providers\RouteServiceProvider;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Symfony\Component\HttpFoundation\Response;
class RedirectIfAuthenticated
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next, string ...$guards): Response
{
$guards = empty($guards) ? [null] : $guards;
foreach ($guards as $guard) {
if (Auth::guard($guard)->check()) {
return redirect(RouteServiceProvider::HOME);
}
}
return $next($request);
}
}

View File

@ -0,0 +1,24 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class SetLocale
{
/**
* Handle an incoming request.
*
* @param Closure(Request): (Response) $next
*/
public function handle($request, Closure $next)
{
$locale = session('locale', 'es');
app()->setLocale($locale);
return $next($request);
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
class TrimStrings extends Middleware
{
/**
* The names of the attributes that should not be trimmed.
*
* @var array<int, string>
*/
protected $except = [
'current_password',
'password',
'password_confirmation',
];
}

View File

@ -0,0 +1,20 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustHosts as Middleware;
class TrustHosts extends Middleware
{
/**
* Get the host patterns that should be trusted.
*
* @return array<int, string|null>
*/
public function hosts(): array
{
return [
$this->allSubdomainsOfApplicationUrl(),
];
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array<int, string>|string|null
*/
protected $proxies;
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
}

View File

@ -0,0 +1,22 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Routing\Middleware\ValidateSignature as Middleware;
class ValidateSignature extends Middleware
{
/**
* The names of the query string parameters that should be ignored.
*
* @var array<int, string>
*/
protected $except = [
// 'fbclid',
// 'utm_campaign',
// 'utm_content',
// 'utm_medium',
// 'utm_source',
// 'utm_term',
];
}

View File

@ -0,0 +1,56 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class VerifyBearerToken
{
public function handle(Request $request, Closure $next): Response
{
/**
* Obtener token desde header:
* Authorization: Bearer TOKEN
*/
$token = $request->bearerToken();
/**
* Token esperado desde .env
*/
$expectedToken = env('API_BEARER_TOKEN');
/**
* Validación básica de existencia
*/
if (!$expectedToken) {
return response()->json([
'error' => 'API token no configurado en .env'
], 500);
}
/**
* Validación de token faltante
*/
if (!$token) {
return response()->json([
'error' => 'Token no enviado'
], 401);
}
/**
* Comparación segura
*/
if (!hash_equals($expectedToken, $token)) {
return response()->json([
'error' => 'No autorizado'
], 401);
}
/**
* Continuar request
*/
return $next($request);
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array<int, string>
*/
protected $except = [
//
];
}

View File

@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Cotizaciones extends Model
{
use HasFactory;
}

46
app/Models/User.php Normal file
View File

@ -0,0 +1,46 @@
<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
class User extends Authenticatable
{
protected $connection = 'mysql2';
use HasApiTokens, HasFactory, Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
'email',
'password',
];
/**
* The attributes that should be hidden for serialization.
*
* @var array<int, string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}

11
app/Models/Vuelos.php Normal file
View File

@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Vuelos extends Model
{
use HasFactory;
}

View File

@ -0,0 +1,12 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class VuelosCotizaciones extends Model
{
use HasFactory;
public $table = 'vuelos_cotizaciones';
}

View File

@ -0,0 +1,24 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
//
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace App\Providers;
// use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
/**
* The model to policy mappings for the application.
*
* @var array<class-string, class-string>
*/
protected $policies = [
//
];
/**
* Register any authentication / authorization services.
*/
public function boot(): void
{
//
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\ServiceProvider;
class BroadcastServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*/
public function boot(): void
{
Broadcast::routes();
require base_path('routes/channels.php');
}
}

View File

@ -0,0 +1,38 @@
<?php
namespace App\Providers;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;
class EventServiceProvider extends ServiceProvider
{
/**
* The event to listener mappings for the application.
*
* @var array<class-string, array<int, class-string>>
*/
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
];
/**
* Register any events for your application.
*/
public function boot(): void
{
//
}
/**
* Determine if events and listeners should be automatically discovered.
*/
public function shouldDiscoverEvents(): bool
{
return false;
}
}

View File

@ -0,0 +1,40 @@
<?php
namespace App\Providers;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider
{
/**
* The path to your application's "home" route.
*
* Typically, users are redirected here after authentication.
*
* @var string
*/
public const HOME = '/home';
/**
* Define your route model bindings, pattern filters, and other route configuration.
*/
public function boot(): void
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
});
$this->routes(function () {
Route::middleware('api')
->prefix('api')
->group(base_path('routes/api.php'));
Route::middleware('web')
->group(base_path('routes/web.php'));
});
}
}

53
artisan Normal file
View File

@ -0,0 +1,53 @@
#!/usr/bin/env php
<?php
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any of our classes manually. It's great to relax.
|
*/
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Artisan Application
|--------------------------------------------------------------------------
|
| When we run the console application, the current CLI command will be
| executed in this console and the response sent back to a terminal
| or another output device for the developers. Here goes nothing!
|
*/
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$status = $kernel->handle(
$input = new Symfony\Component\Console\Input\ArgvInput,
new Symfony\Component\Console\Output\ConsoleOutput
);
/*
|--------------------------------------------------------------------------
| Shutdown The Application
|--------------------------------------------------------------------------
|
| Once Artisan has finished running, we will fire off the shutdown events
| so that any final work may be done by the application before we shut
| down the process. This is the last thing to happen to the request.
|
*/
$kernel->terminate($input, $status);
exit($status);

55
bootstrap/app.php Normal file
View File

@ -0,0 +1,55 @@
<?php
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
|
*/
$app = new Illuminate\Foundation\Application(
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);
/*
|--------------------------------------------------------------------------
| Bind Important Interfaces
|--------------------------------------------------------------------------
|
| Next, we need to bind some important interfaces into the container so
| we will be able to resolve them when needed. The kernels serve the
| incoming requests to this application from both the web and CLI.
|
*/
$app->singleton(
Illuminate\Contracts\Http\Kernel::class,
App\Http\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Console\Kernel::class,
App\Console\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Debug\ExceptionHandler::class,
App\Exceptions\Handler::class
);
/*
|--------------------------------------------------------------------------
| Return The Application
|--------------------------------------------------------------------------
|
| This script returns the application instance. The instance is given to
| the calling script so we can separate the building of the instances
| from the actual running of the application and sending responses.
|
*/
return $app;

2
bootstrap/cache/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

70
composer.json Normal file
View File

@ -0,0 +1,70 @@
{
"name": "laravel/laravel",
"type": "project",
"description": "The skeleton application for the Laravel framework.",
"keywords": ["laravel", "framework"],
"license": "MIT",
"require": {
"php": "^8.1",
"artesaos/seotools": "^1.4",
"barryvdh/laravel-dompdf": "^3.1",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.10",
"laravel/sanctum": "^3.3",
"laravel/tinker": "^2.8",
"laravel/ui": "^4.6",
"picqer/php-barcode-generator": "^3.2"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"laravel/pint": "^1.0",
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^7.0",
"phpunit/phpunit": "^10.1",
"spatie/laravel-ignition": "^2.0"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"php-http/discovery": true
}
},
"minimum-stability": "stable",
"prefer-stable": true
}

8969
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

189
config/app.php Normal file
View File

@ -0,0 +1,189 @@
<?php
use Illuminate\Support\Facades\Facade;
use Illuminate\Support\ServiceProvider;
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
|
*/
'name' => env('APP_NAME', 'Laravel'),
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services the application utilizes. Set this in your ".env" file.
|
*/
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => (bool) env('APP_DEBUG', false),
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => env('APP_URL', 'http://localhost'),
'asset_url' => env('ASSET_URL'),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => 'UTC',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => 'en',
/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/
'fallback_locale' => 'en',
/*
|--------------------------------------------------------------------------
| Faker Locale
|--------------------------------------------------------------------------
|
| This locale will be used by the Faker PHP library when generating fake
| data for your database seeds. For example, this will be used to get
| localized telephone numbers, street address information and more.
|
*/
'faker_locale' => 'en_US',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
/*
|--------------------------------------------------------------------------
| Maintenance Mode Driver
|--------------------------------------------------------------------------
|
| These configuration options determine the driver used to determine and
| manage Laravel's "maintenance mode" status. The "cache" driver will
| allow maintenance mode to be controlled across multiple machines.
|
| Supported drivers: "file", "cache"
|
*/
'maintenance' => [
'driver' => 'file',
// 'store' => 'redis',
],
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => ServiceProvider::defaultProviders()->merge([
/*
* Package Service Providers...
*/
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
])->toArray(),
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => Facade::defaultAliases()->merge([
'SEOTools' => Artesaos\SEOTools\Facades\SEOTools::class,
// 'Example' => App\Facades\Example::class,
])->toArray(),
];

122
config/auth.php Normal file
View File

@ -0,0 +1,122 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| as required, but they're a perfect start for most applications.
|
*/
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| here which uses session storage and the Eloquent user provider.
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| Supported: "session"
|
*/
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
],
'providers' => [
'users_mysql2' => [
'driver' => 'eloquent',
'model' => App\Models\User::class,
],
],
/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| If you have multiple user tables or models you may configure multiple
| sources which represent each model / table. These sources may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\Models\User::class,
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
/*
|--------------------------------------------------------------------------
| Resetting Passwords
|--------------------------------------------------------------------------
|
| You may specify multiple password reset configurations if you have more
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
| The expiry time is the number of minutes that each reset token will be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
| The throttle setting is the number of seconds a user must wait before
| generating more password reset tokens. This prevents the user from
| quickly generating a very large amount of password reset tokens.
|
*/
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_reset_tokens',
'expire' => 60,
'throttle' => 60,
],
],
/*
|--------------------------------------------------------------------------
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| times out and the user is prompted to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/
'password_timeout' => 10800,
];

71
config/broadcasting.php Normal file
View File

@ -0,0 +1,71 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Broadcaster
|--------------------------------------------------------------------------
|
| This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "pusher", "ably", "redis", "log", "null"
|
*/
'default' => env('BROADCAST_DRIVER', 'null'),
/*
|--------------------------------------------------------------------------
| Broadcast Connections
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of
| each available type of connection are provided inside this array.
|
*/
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
'port' => env('PUSHER_PORT', 443),
'scheme' => env('PUSHER_SCHEME', 'https'),
'encrypted' => true,
'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
],
'client_options' => [
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
],
],
'ably' => [
'driver' => 'ably',
'key' => env('ABLY_KEY'),
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
'log' => [
'driver' => 'log',
],
'null' => [
'driver' => 'null',
],
],
];

111
config/cache.php Normal file
View File

@ -0,0 +1,111 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Cache Store
|--------------------------------------------------------------------------
|
| This option controls the default cache connection that gets used while
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
*/
'default' => env('CACHE_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Cache Stores
|--------------------------------------------------------------------------
|
| Here you may define all of the cache "stores" for your application as
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
| Supported drivers: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb", "octane", "null"
|
*/
'stores' => [
'apc' => [
'driver' => 'apc',
],
'array' => [
'driver' => 'array',
'serialize' => false,
],
'database' => [
'driver' => 'database',
'table' => 'cache',
'connection' => null,
'lock_connection' => null,
],
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
'lock_path' => storage_path('framework/cache/data'),
],
'memcached' => [
'driver' => 'memcached',
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
'sasl' => [
env('MEMCACHED_USERNAME'),
env('MEMCACHED_PASSWORD'),
],
'options' => [
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
],
'servers' => [
[
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
'port' => env('MEMCACHED_PORT', 11211),
'weight' => 100,
],
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'cache',
'lock_connection' => 'default',
],
'dynamodb' => [
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'endpoint' => env('DYNAMODB_ENDPOINT'),
],
'octane' => [
'driver' => 'octane',
],
],
/*
|--------------------------------------------------------------------------
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing the APC, database, memcached, Redis, or DynamoDB cache
| stores there might be other applications using the same cache. For
| that reason, you may prefix every cache key to avoid collisions.
|
*/
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
];

6
config/clip.php Normal file
View File

@ -0,0 +1,6 @@
<?php
return [
'api_key' => env('CLIP_API_KEY'),
'payments_url' => env('CLIP_PAYMENTS_URL', 'https://api.payclip.com/payments'),
];

34
config/cors.php Normal file
View File

@ -0,0 +1,34 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Cross-Origin Resource Sharing (CORS) Configuration
|--------------------------------------------------------------------------
|
| Here you may configure your settings for cross-origin resource sharing
| or "CORS". This determines what cross-origin operations may execute
| in web browsers. You are free to adjust these settings as needed.
|
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
*/
'paths' => ['api/*', 'sanctum/csrf-cookie'],
'allowed_methods' => ['*'],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => false,
];

172
config/database.php Normal file
View File

@ -0,0 +1,172 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => env('DB_CONNECTION', 'mysql'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'url' => env('DATABASE_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
],
'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'mysql2' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL_2'),
'host' => env('DB_HOST_2', '127.0.0.1'),
'port' => env('DB_PORT_2', '3306'),
'database' => env('DB_DATABASE_2', 'forge'),
'username' => env('DB_USERNAME_2', 'forge'),
'password' => env('DB_PASSWORD_2', ''),
'unix_socket' => env('DB_SOCKET_2', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA_2'),
]) : [],
],
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'search_path' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer body of commands than a typical key-value system
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'client' => env('REDIS_CLIENT', 'phpredis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'),
],
'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'),
],
'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_CACHE_DB', '1'),
],
],
];

301
config/dompdf.php Normal file
View File

@ -0,0 +1,301 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Settings
|--------------------------------------------------------------------------
|
| Set some default values. It is possible to add all defines that can be set
| in dompdf_config.inc.php. You can also override the entire config file.
|
*/
'show_warnings' => false, // Throw an Exception on warnings from dompdf
'public_path' => null, // Override the public path if needed
/*
* Dejavu Sans font is missing glyphs for converted entities, turn it off if you need to show € and £.
*/
'convert_entities' => true,
'options' => [
/**
* The location of the DOMPDF font directory
*
* The location of the directory where DOMPDF will store fonts and font metrics
* Note: This directory must exist and be writable by the webserver process.
* *Please note the trailing slash.*
*
* Notes regarding fonts:
* Additional .afm font metrics can be added by executing load_font.php from command line.
*
* Only the original "Base 14 fonts" are present on all pdf viewers. Additional fonts must
* be embedded in the pdf file or the PDF may not display correctly. This can significantly
* increase file size unless font subsetting is enabled. Before embedding a font please
* review your rights under the font license.
*
* Any font specification in the source HTML is translated to the closest font available
* in the font directory.
*
* The pdf standard "Base 14 fonts" are:
* Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique,
* Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique,
* Times-Roman, Times-Bold, Times-BoldItalic, Times-Italic,
* Symbol, ZapfDingbats.
*/
'font_dir' => storage_path('fonts'), // advised by dompdf (https://github.com/dompdf/dompdf/pull/782)
/**
* The location of the DOMPDF font cache directory
*
* This directory contains the cached font metrics for the fonts used by DOMPDF.
* This directory can be the same as DOMPDF_FONT_DIR
*
* Note: This directory must exist and be writable by the webserver process.
*/
'font_cache' => storage_path('fonts'),
/**
* The location of a temporary directory.
*
* The directory specified must be writeable by the webserver process.
* The temporary directory is required to download remote images and when
* using the PDFLib back end.
*/
'temp_dir' => sys_get_temp_dir(),
/**
* ==== IMPORTANT ====
*
* dompdf's "chroot": Prevents dompdf from accessing system files or other
* files on the webserver. All local files opened by dompdf must be in a
* subdirectory of this directory. DO NOT set it to '/' since this could
* allow an attacker to use dompdf to read any files on the server. This
* should be an absolute path.
* This is only checked on command line call by dompdf.php, but not by
* direct class use like:
* $dompdf = new DOMPDF(); $dompdf->load_html($htmldata); $dompdf->render(); $pdfdata = $dompdf->output();
*/
'chroot' => realpath(base_path()),
/**
* Protocol whitelist
*
* Protocols and PHP wrappers allowed in URIs, and the validation rules
* that determine if a resouce may be loaded. Full support is not guaranteed
* for the protocols/wrappers specified
* by this array.
*
* @var array
*/
'allowed_protocols' => [
'data://' => ['rules' => []],
'file://' => ['rules' => []],
'http://' => ['rules' => []],
'https://' => ['rules' => []],
],
/**
* Operational artifact (log files, temporary files) path validation
*/
'artifactPathValidation' => null,
/**
* @var string
*/
'log_output_file' => null,
/**
* Whether to enable font subsetting or not.
*/
'enable_font_subsetting' => false,
/**
* The PDF rendering backend to use
*
* Valid settings are 'PDFLib', 'CPDF' (the bundled R&OS PDF class), 'GD' and
* 'auto'. 'auto' will look for PDFLib and use it if found, or if not it will
* fall back on CPDF. 'GD' renders PDFs to graphic files.
* {@link * Canvas_Factory} ultimately determines which rendering class to
* instantiate based on this setting.
*
* Both PDFLib & CPDF rendering backends provide sufficient rendering
* capabilities for dompdf, however additional features (e.g. object,
* image and font support, etc.) differ between backends. Please see
* {@link PDFLib_Adapter} for more information on the PDFLib backend
* and {@link CPDF_Adapter} and lib/class.pdf.php for more information
* on CPDF. Also see the documentation for each backend at the links
* below.
*
* The GD rendering backend is a little different than PDFLib and
* CPDF. Several features of CPDF and PDFLib are not supported or do
* not make any sense when creating image files. For example,
* multiple pages are not supported, nor are PDF 'objects'. Have a
* look at {@link GD_Adapter} for more information. GD support is
* experimental, so use it at your own risk.
*
* @link http://www.pdflib.com
* @link http://www.ros.co.nz/pdf
* @link http://www.php.net/image
*/
'pdf_backend' => 'CPDF',
/**
* html target media view which should be rendered into pdf.
* List of types and parsing rules for future extensions:
* http://www.w3.org/TR/REC-html40/types.html
* screen, tty, tv, projection, handheld, print, braille, aural, all
* Note: aural is deprecated in CSS 2.1 because it is replaced by speech in CSS 3.
* Note, even though the generated pdf file is intended for print output,
* the desired content might be different (e.g. screen or projection view of html file).
* Therefore allow specification of content here.
*/
'default_media_type' => 'screen',
/**
* The default paper size.
*
* North America standard is "letter"; other countries generally "a4"
*
* @see CPDF_Adapter::PAPER_SIZES for valid sizes ('letter', 'legal', 'A4', etc.)
*/
'default_paper_size' => 'a4',
/**
* The default paper orientation.
*
* The orientation of the page (portrait or landscape).
*
* @var string
*/
'default_paper_orientation' => 'portrait',
/**
* The default font family
*
* Used if no suitable fonts can be found. This must exist in the font folder.
*
* @var string
*/
'default_font' => 'serif',
/**
* Image DPI setting
*
* This setting determines the default DPI setting for images and fonts. The
* DPI may be overridden for inline images by explictly setting the
* image's width & height style attributes (i.e. if the image's native
* width is 600 pixels and you specify the image's width as 72 points,
* the image will have a DPI of 600 in the rendered PDF. The DPI of
* background images can not be overridden and is controlled entirely
* via this parameter.
*
* For the purposes of DOMPDF, pixels per inch (PPI) = dots per inch (DPI).
* If a size in html is given as px (or without unit as image size),
* this tells the corresponding size in pt.
* This adjusts the relative sizes to be similar to the rendering of the
* html page in a reference browser.
*
* In pdf, always 1 pt = 1/72 inch
*
* Rendering resolution of various browsers in px per inch:
* Windows Firefox and Internet Explorer:
* SystemControl->Display properties->FontResolution: Default:96, largefonts:120, custom:?
* Linux Firefox:
* about:config *resolution: Default:96
* (xorg screen dimension in mm and Desktop font dpi settings are ignored)
*
* Take care about extra font/image zoom factor of browser.
*
* In images, <img> size in pixel attribute, img css style, are overriding
* the real image dimension in px for rendering.
*
* @var int
*/
'dpi' => 96,
/**
* Enable embedded PHP
*
* If this setting is set to true then DOMPDF will automatically evaluate embedded PHP contained
* within <script type="text/php"> ... </script> tags.
*
* ==== IMPORTANT ==== Enabling this for documents you do not trust (e.g. arbitrary remote html pages)
* is a security risk.
* Embedded scripts are run with the same level of system access available to dompdf.
* Set this option to false (recommended) if you wish to process untrusted documents.
* This setting may increase the risk of system exploit.
* Do not change this settings without understanding the consequences.
* Additional documentation is available on the dompdf wiki at:
* https://github.com/dompdf/dompdf/wiki
*
* @var bool
*/
'enable_php' => false,
/**
* Enable inline JavaScript
*
* If this setting is set to true then DOMPDF will automatically insert JavaScript code contained
* within <script type="text/javascript"> ... </script> tags as written into the PDF.
* NOTE: This is PDF-based JavaScript to be executed by the PDF viewer,
* not browser-based JavaScript executed by Dompdf.
*
* @var bool
*/
'enable_javascript' => true,
/**
* Enable remote file access
*
* If this setting is set to true, DOMPDF will access remote sites for
* images and CSS files as required.
*
* ==== IMPORTANT ====
* This can be a security risk, in particular in combination with isPhpEnabled and
* allowing remote html code to be passed to $dompdf = new DOMPDF(); $dompdf->load_html(...);
* This allows anonymous users to download legally doubtful internet content which on
* tracing back appears to being downloaded by your server, or allows malicious php code
* in remote html pages to be executed by your server with your account privileges.
*
* This setting may increase the risk of system exploit. Do not change
* this settings without understanding the consequences. Additional
* documentation is available on the dompdf wiki at:
* https://github.com/dompdf/dompdf/wiki
*
* @var bool
*/
'enable_remote' => false,
/**
* List of allowed remote hosts
*
* Each value of the array must be a valid hostname.
*
* This will be used to filter which resources can be loaded in combination with
* isRemoteEnabled. If enable_remote is FALSE, then this will have no effect.
*
* Leave to NULL to allow any remote host.
*
* @var array|null
*/
'allowed_remote_hosts' => null,
/**
* A ratio applied to the fonts height to be more like browsers' line height
*/
'font_height_ratio' => 1.1,
/**
* Use the HTML5 Lib parser
*
* @deprecated This feature is now always on in dompdf 2.x
*
* @var bool
*/
'enable_html5_parser' => true,
],
];

76
config/filesystems.php Normal file
View File

@ -0,0 +1,76 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away!
|
*/
'default' => env('FILESYSTEM_DISK', 'local'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been set up for each driver as an example of the required values.
|
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => false,
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => false,
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
],
],
/*
|--------------------------------------------------------------------------
| Symbolic Links
|--------------------------------------------------------------------------
|
| Here you may configure the symbolic links that will be created when the
| `storage:link` Artisan command is executed. The array keys should be
| the locations of the links and the values should be their targets.
|
*/
'links' => [
public_path('storage') => storage_path('app/public'),
],
];

54
config/hashing.php Normal file
View File

@ -0,0 +1,54 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Hash Driver
|--------------------------------------------------------------------------
|
| This option controls the default hash driver that will be used to hash
| passwords for your application. By default, the bcrypt algorithm is
| used; however, you remain free to modify this option if you wish.
|
| Supported: "bcrypt", "argon", "argon2id"
|
*/
'driver' => 'bcrypt',
/*
|--------------------------------------------------------------------------
| Bcrypt Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Bcrypt algorithm. This will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 12),
'verify' => true,
],
/*
|--------------------------------------------------------------------------
| Argon Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Argon algorithm. These will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'argon' => [
'memory' => 65536,
'threads' => 1,
'time' => 4,
'verify' => true,
],
];

131
config/logging.php Normal file
View File

@ -0,0 +1,131 @@
<?php
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
use Monolog\Processor\PsrLogMessageProcessor;
return [
/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
| This option defines the default log channel that gets used when writing
| messages to the logs. The name specified in this option should match
| one of the channels defined in the "channels" configuration array.
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| Deprecations Log Channel
|--------------------------------------------------------------------------
|
| This option controls the log channel that should be used to log warnings
| regarding deprecated PHP and library features. This allows you to get
| your application ready for upcoming major versions of dependencies.
|
*/
'deprecations' => [
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
'trace' => false,
],
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog",
| "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single'],
'ignore_exceptions' => false,
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'days' => 14,
'replace_placeholders' => true,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log',
'emoji' => ':boom:',
'level' => env('LOG_LEVEL', 'critical'),
'replace_placeholders' => true,
],
'papertrail' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
],
'processors' => [PsrLogMessageProcessor::class],
],
'stderr' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'stream' => 'php://stderr',
],
'processors' => [PsrLogMessageProcessor::class],
],
'syslog' => [
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
'facility' => LOG_USER,
'replace_placeholders' => true,
],
'errorlog' => [
'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],
'null' => [
'driver' => 'monolog',
'handler' => NullHandler::class,
],
'emergency' => [
'path' => storage_path('logs/laravel.log'),
],
],
];

134
config/mail.php Normal file
View File

@ -0,0 +1,134 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Mailer
|--------------------------------------------------------------------------
|
| This option controls the default mailer that is used to send any email
| messages sent by your application. Alternative mailers may be setup
| and used as needed; however, this mailer will be used by default.
|
*/
'default' => env('MAIL_MAILER', 'smtp'),
/*
|--------------------------------------------------------------------------
| Mailer Configurations
|--------------------------------------------------------------------------
|
| Here you may configure all of the mailers used by your application plus
| their respective settings. Several examples have been configured for
| you and you are free to add your own as your application requires.
|
| Laravel supports a variety of mail "transport" drivers to be used while
| sending an e-mail. You will specify which one you are using for your
| mailers below. You are free to add additional mailers as required.
|
| Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
| "postmark", "log", "array", "failover", "roundrobin"
|
*/
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'url' => env('MAIL_URL'),
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'local_domain' => env('MAIL_EHLO_DOMAIN'),
],
'ses' => [
'transport' => 'ses',
],
'postmark' => [
'transport' => 'postmark',
// 'message_stream_id' => null,
// 'client' => [
// 'timeout' => 5,
// ],
],
'mailgun' => [
'transport' => 'mailgun',
// 'client' => [
// 'timeout' => 5,
// ],
],
'sendmail' => [
'transport' => 'sendmail',
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
],
'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL'),
],
'array' => [
'transport' => 'array',
],
'failover' => [
'transport' => 'failover',
'mailers' => [
'smtp',
'log',
],
],
'roundrobin' => [
'transport' => 'roundrobin',
'mailers' => [
'ses',
'postmark',
],
],
],
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
/*
|--------------------------------------------------------------------------
| Markdown Mail Settings
|--------------------------------------------------------------------------
|
| If you are using Markdown based email rendering, you may configure your
| theme and component paths here, allowing you to customize the design
| of the emails. Or, you may simply stick with the Laravel defaults!
|
*/
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
];

109
config/queue.php Normal file
View File

@ -0,0 +1,109 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Queue Connection Name
|--------------------------------------------------------------------------
|
| Laravel's queue API supports an assortment of back-ends via a single
| API, giving you convenient access to each back-end using the same
| syntax for every one. Here you may define a default connection.
|
*/
'default' => env('QUEUE_CONNECTION', 'sync'),
/*
|--------------------------------------------------------------------------
| Queue Connections
|--------------------------------------------------------------------------
|
| Here you may configure the connection information for each server that
| is used by your application. A default configuration has been added
| for each back-end shipped with Laravel. You are free to add more.
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
*/
'connections' => [
'sync' => [
'driver' => 'sync',
],
'database' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
'after_commit' => false,
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
'retry_after' => 90,
'block_for' => 0,
'after_commit' => false,
],
'sqs' => [
'driver' => 'sqs',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'default'),
'suffix' => env('SQS_SUFFIX'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'after_commit' => false,
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => 90,
'block_for' => null,
'after_commit' => false,
],
],
/*
|--------------------------------------------------------------------------
| Job Batching
|--------------------------------------------------------------------------
|
| The following options configure the database and table that store job
| batching information. These options can be updated to any database
| connection and table which has been defined by your application.
|
*/
'batching' => [
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'job_batches',
],
/*
|--------------------------------------------------------------------------
| Failed Queue Jobs
|--------------------------------------------------------------------------
|
| These options configure the behavior of failed queue job logging so you
| can control which database and table are used to store the jobs that
| have failed. You may change them to any database / table you wish.
|
*/
'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs',
],
];

83
config/sanctum.php Normal file
View File

@ -0,0 +1,83 @@
<?php
use Laravel\Sanctum\Sanctum;
return [
/*
|--------------------------------------------------------------------------
| Stateful Domains
|--------------------------------------------------------------------------
|
| Requests from the following domains / hosts will receive stateful API
| authentication cookies. Typically, these should include your local
| and production domains which access your API via a frontend SPA.
|
*/
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
'%s%s',
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
Sanctum::currentApplicationUrlWithPort()
))),
/*
|--------------------------------------------------------------------------
| Sanctum Guards
|--------------------------------------------------------------------------
|
| This array contains the authentication guards that will be checked when
| Sanctum is trying to authenticate a request. If none of these guards
| are able to authenticate the request, Sanctum will use the bearer
| token that's present on an incoming request for authentication.
|
*/
'guard' => ['web'],
/*
|--------------------------------------------------------------------------
| Expiration Minutes
|--------------------------------------------------------------------------
|
| This value controls the number of minutes until an issued token will be
| considered expired. This will override any values set in the token's
| "expires_at" attribute, but first-party sessions are not affected.
|
*/
'expiration' => null,
/*
|--------------------------------------------------------------------------
| Token Prefix
|--------------------------------------------------------------------------
|
| Sanctum can prefix new tokens in order to take advantage of numerous
| security scanning initiatives maintained by open source platforms
| that notify developers if they commit tokens into repositories.
|
| See: https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning
|
*/
'token_prefix' => env('SANCTUM_TOKEN_PREFIX', ''),
/*
|--------------------------------------------------------------------------
| Sanctum Middleware
|--------------------------------------------------------------------------
|
| When authenticating your first-party SPA with Sanctum you may need to
| customize some of the middleware Sanctum uses while processing the
| request. You may change the middleware listed below as required.
|
*/
'middleware' => [
'authenticate_session' => Laravel\Sanctum\Http\Middleware\AuthenticateSession::class,
'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
],
];

69
config/seotools.php Normal file
View File

@ -0,0 +1,69 @@
<?php
/**
* @see https://github.com/artesaos/seotools
*/
return [
'inertia' => env('SEO_TOOLS_INERTIA', false),
'meta' => [
/*
* The default configurations to be used by the meta generator.
*/
'defaults' => [
'title' => "It's", // set false to total remove
'titleBefore' => false, // Put defaults.title before page title, like 'It's Over 9000! - Dashboard'
'description' => 'For those who helped create the Genki Dama', // set false to total remove
'separator' => ' - ',
'keywords' => [],
'canonical' => false, // Set to null or 'full' to use Url::full(), set to 'current' to use Url::current(), set false to total remove
'robots' => false, // Set to 'all', 'none' or any combination of index/noindex and follow/nofollow
],
/*
* Webmaster tags are always added.
*/
'webmaster_tags' => [
'google' => null,
'bing' => null,
'alexa' => null,
'pinterest' => null,
'yandex' => null,
'norton' => null,
],
'add_notranslate_class' => false,
],
'opengraph' => [
/*
* The default configurations to be used by the opengraph generator.
*/
'defaults' => [
'title' => 'Over', // set false to total remove
'description' => 'For those who helped create the Genki Dama', // set false to total remove
'url' => false, // Set null for using Url::current(), set false to total remove
'type' => false,
'site_name' => false,
'images' => [],
],
],
'twitter' => [
/*
* The default values to be used by the twitter cards generator.
*/
'defaults' => [
//'card' => 'summary',
//'site' => '@LuizVinicius73',
],
],
'json-ld' => [
/*
* The default configurations to be used by the json-ld generator.
*/
'defaults' => [
'title' => 'Over 9000 Thousand!', // set false to total remove
'description' => 'For those who helped create the Genki Dama', // set false to total remove
'url' => false, // Set to null or 'full' to use Url::full(), set to 'current' to use Url::current(), set false to total remove
'type' => 'WebPage',
'images' => [],
],
],
];

37
config/services.php Normal file
View File

@ -0,0 +1,37 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Mailgun, Postmark, AWS and more. This file provides the de facto
| location for this type of information, allowing packages to have
| a conventional file to locate the various service credentials.
|
*/
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
'scheme' => 'https',
],
'postmark' => [
'token' => env('POSTMARK_TOKEN'),
],
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'telegram' => [
'token' => env('TELEGRAM_BOT_TOKEN'),
'base_url' => env('TELEGRAM_API_URL', 'https://api.telegram.org'),
],
];

214
config/session.php Normal file
View File

@ -0,0 +1,214 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "dynamodb", "array"
|
*/
'driver' => env('SESSION_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
'lifetime' => env('SESSION_LIFETIME', 120),
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session Encryption
|--------------------------------------------------------------------------
|
| This option allows you to easily specify that all of your session data
| should be encrypted before it is stored. All encryption will be run
| automatically by Laravel and you can use the Session like normal.
|
*/
'encrypt' => false,
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/
'files' => storage_path('framework/sessions'),
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => env('SESSION_CONNECTION'),
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
|
*/
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Cache Store
|--------------------------------------------------------------------------
|
| While using one of the framework's cache driven session backends you may
| list a cache store that should be used for these sessions. This value
| must match with one of the application's configured cache "stores".
|
| Affects: "apc", "dynamodb", "memcached", "redis"
|
*/
'store' => env('SESSION_STORE'),
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => [2, 100],
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
|
*/
'cookie' => env(
'SESSION_COOKIE',
Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
),
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application but you are free to change this when necessary.
|
*/
'path' => '/',
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => env('SESSION_DOMAIN'),
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you when it can't be done securely.
|
*/
'secure' => env('SESSION_SECURE_COOKIE'),
/*
|--------------------------------------------------------------------------
| HTTP Access Only
|--------------------------------------------------------------------------
|
| Setting this value to true will prevent JavaScript from accessing the
| value of the cookie and the cookie will only be accessible through
| the HTTP protocol. You are free to modify this option if needed.
|
*/
'http_only' => true,
/*
|--------------------------------------------------------------------------
| Same-Site Cookies
|--------------------------------------------------------------------------
|
| This option determines how your cookies behave when cross-site requests
| take place, and can be used to mitigate CSRF attacks. By default, we
| will set this value to "lax" since this is a secure default value.
|
| Supported: "lax", "strict", "none", null
|
*/
'same_site' => 'lax',
/*
|--------------------------------------------------------------------------
| Partitioned Cookies
|--------------------------------------------------------------------------
|
| Setting this value to true will tie the cookie to the top-level site for
| a cross-site context. Partitioned cookies are accepted by the browser
| when flagged "secure" and the Same-Site attribute is set to "none".
|
*/
'partitioned' => false,
];

9
config/sitioweb.php Normal file
View File

@ -0,0 +1,9 @@
<?php
return [
'nombre_sitio' => 'Vuelo en globo',
'sitio_web_erp_id' => '2',
'numero_atencion_clientes' => '+52 55 1234 5678',
'correo_atencion_clientes' => '',
'telegram_chat_id' => '8446032916'
];

36
config/view.php Normal file
View File

@ -0,0 +1,36 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most templating systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views. Of course
| the usual Laravel view path has already been registered for you.
|
*/
'paths' => [
resource_path('views'),
],
/*
|--------------------------------------------------------------------------
| Compiled View Path
|--------------------------------------------------------------------------
|
| This option determines where all the compiled Blade templates will be
| stored for your application. Typically, this is within the storage
| directory. However, as usual, you are free to change this value.
|
*/
'compiled' => env(
'VIEW_COMPILED_PATH',
realpath(storage_path('framework/views'))
),
];

68
cspell.json Normal file
View File

@ -0,0 +1,68 @@
{
"version": "0.2",
"language": "en,es",
"languageSettings": [
{
"languageId": "markdown",
"dictionaries": ["en", "es", "custom"]
},
{
"languageId": "php",
"dictionaries": ["en", "es", "custom"]
},
{
"languageId": "javascript",
"dictionaries": ["en", "es", "custom"]
}
],
"ignorePaths": [
"**/node_modules/**",
"**/vendor/**",
"**/dist/**",
"**/build/**",
"**/storage/**",
"**/public/**",
"**/*.min.js",
"**/*.min.css",
"**/*.lock"
],
"dictionaryDefinitions": [
{
"name": "custom",
"path": "./.cspell/custom-words.txt",
"addWords": true
}
],
"dictionaries": ["en", "es", "custom"],
"words": [
"Laravel",
"Blade",
"Eloquent",
"Alpinejs",
"Livewire",
"Tailwind",
"Select2",
"DataTable",
"middleware",
"csrf",
"API",
"JSON",
"MVC",
"CRUD",
"PDO"
],
"ignoreWords": [],
"caseSensitive": false,
"allowCompoundWords": true,
"import": []
}

1
database/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.sqlite*

View File

@ -0,0 +1,44 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
*/
class UserFactory extends Factory
{
/**
* The current password being used by the factory.
*/
protected static ?string $password;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => static::$password ??= Hash::make('password'),
'remember_token' => Str::random(10),
];
}
/**
* Indicate that the model's email address should be unverified.
*/
public function unverified(): static
{
return $this->state(fn (array $attributes) => [
'email_verified_at' => null,
]);
}
}

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
protected $connection = 'mysql2';
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('users');
}
};

View File

@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
protected $connection = 'mysql2';
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('password_reset_tokens');
}
};

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
protected $connection = 'mysql2';
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
};

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
protected $connection = 'mysql2';
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('failed_jobs', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('failed_jobs');
}
};

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
protected $connection = 'mysql2';
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('personal_access_tokens', function (Blueprint $table) {
$table->id();
$table->morphs('tokenable');
$table->string('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamp('expires_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('personal_access_tokens');
}
};

View File

@ -0,0 +1,22 @@
<?php
namespace Database\Seeders;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*/
public function run(): void
{
// \App\Models\User::factory(10)->create();
// \App\Models\User::factory()->create([
// 'name' => 'Test User',
// 'email' => 'test@example.com',
// ]);
}
}

13
package.json Normal file
View File

@ -0,0 +1,13 @@
{
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"axios": "^1.6.4",
"laravel-vite-plugin": "^1.0.0",
"vite": "^5.0.0"
}
}

32
phpunit.xml Normal file
View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Unit">
<directory>tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory>tests/Feature</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>app</directory>
</include>
</source>
<php>
<env name="APP_ENV" value="testing"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" value="array"/>
<!-- <env name="DB_CONNECTION" value="sqlite"/> -->
<!-- <env name="DB_DATABASE" value=":memory:"/> -->
<env name="MAIL_MAILER" value="array"/>
<env name="PULSE_ENABLED" value="false"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="TELESCOPE_ENABLED" value="false"/>
</php>
</phpunit>

BIN
public/.DS_Store vendored Normal file

Binary file not shown.

21
public/.htaccess Normal file
View File

@ -0,0 +1,21 @@
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

BIN
public/assets/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

180
public/assets/css/aviso.css Normal file
View File

@ -0,0 +1,180 @@
/* ==================== */
/* AVISO DE PRIVACIDAD - ESTILOS AISLADOS */
/* ==================== */
.privacy-container {
max-width: var(--max-width, 1200px);
margin: 0 auto;
padding: 2rem clamp(1rem, 3vw, 2rem);
margin-top: calc(var(--navbar-height, 80px) + 1rem);
}
/* Encabezado principal */
.privacy-header {
text-align: center;
margin-bottom: 3rem;
padding: 3rem 2rem;
background: var(--secondary, #1a1d23);
border-radius: 40px;
border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
}
.privacy-header h1 {
font-family: "Space Grotesk", sans-serif;
font-size: clamp(2rem, 4vw, 3rem);
font-weight: 700;
background: linear-gradient(
135deg,
var(--text-primary, #fff),
var(--accent, #04cdff)
);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
margin-bottom: 0.5rem;
}
.privacy-header .company {
color: var(--accent, #04cdff);
font-size: 1.1rem;
}
.privacy-header .date {
font-size: 0.85rem;
color: var(--text-tertiary, #718096);
margin-top: 1rem;
}
/* Tabla de contenidos */
.privacy-toc {
background: var(--surface, rgba(26, 29, 35, 0.85));
backdrop-filter: blur(10px);
border-radius: 24px;
padding: 1.5rem;
margin-bottom: 2rem;
border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
}
.privacy-toc h3 {
margin-bottom: 1rem;
color: var(--text-primary, #fff);
font-size: 1.2rem;
}
.privacy-toc-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 0.5rem;
}
.privacy-toc-link {
color: var(--text-secondary, #a0aec0);
text-decoration: none;
font-size: 0.85rem;
display: block;
padding: 0.5rem 0;
transition: all var(--transition-fast, 0.2s ease);
}
.privacy-toc-link:hover {
color: var(--accent, #04cdff);
transform: translateX(5px);
}
/* Secciones */
.privacy-section {
background: var(--surface, rgba(26, 29, 35, 0.85));
backdrop-filter: blur(10px);
border-radius: 24px;
padding: 1.8rem;
margin-bottom: 1.5rem;
border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
transition: all var(--transition-base, 0.4s ease);
scroll-margin-top: 100px;
}
.privacy-section:hover {
border-color: var(--accent, #04cdff);
box-shadow: var(--shadow-md, 0 8px 32px rgba(0, 0, 0, 0.4));
}
.privacy-section h2 {
color: var(--text-primary, #fff);
font-size: 1.5rem;
padding-bottom: 0.5rem;
border-bottom: 2px solid var(--accent, #04cdff);
margin-bottom: 1rem;
font-family: "Space Grotesk", sans-serif;
}
.privacy-section h3 {
color: var(--accent, #04cdff);
font-size: 1.1rem;
margin: 1.2rem 0 0.8rem 0;
}
.privacy-section p {
line-height: 1.7;
color: var(--text-secondary, #a0aec0);
margin-bottom: 0.8rem;
}
.privacy-section ul,
.privacy-section ol {
margin: 0.8rem 0;
padding-left: 1.5rem;
color: var(--text-secondary, #a0aec0);
}
.privacy-section li {
line-height: 1.7;
margin-bottom: 0.3rem;
}
.privacy-highlight {
background: rgba(4, 205, 255, 0.08);
border-left: 4px solid var(--accent, #04cdff);
padding: 1.2rem;
margin: 1.2rem 0;
border-radius: 16px;
}
.privacy-warning {
background: rgba(245, 101, 101, 0.1);
border-left: 4px solid #f56565;
padding: 1.2rem;
margin: 1.2rem 0;
border-radius: 16px;
}
.privacy-warning strong,
.privacy-highlight strong {
color: var(--text-primary, #fff);
}
.privacy-legal-note {
text-align: center;
font-size: 0.8rem;
color: var(--text-tertiary, #718096);
margin-top: 2rem;
padding-top: 1.5rem;
border-top: 1px solid var(--border, rgba(255, 255, 255, 0.12));
}
@media (max-width: 768px) {
.privacy-container {
margin-top: calc(var(--navbar-height-mobile, 70px) + 0.5rem);
}
.privacy-section h2 {
font-size: 1.3rem;
}
.privacy-toc-grid {
grid-template-columns: 1fr;
}
.privacy-header {
padding: 2rem 1rem;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,535 @@
/* ============================================================
CONTACTO PAGE — UX/UI ENHANCEMENTS
Todos los selectores son específicos a esta página.
No afectan al layout ni a otros blades.
============================================================ */
/* ---------- ENTRADA ANIMADA DE SECCIONES (Intersection Observer) ---------- */
.contact-cards .contact-card-modern,
.contact-wrapper,
.map-container-modern {
opacity: 0;
transform: translateY(32px);
transition:
opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.contact-cards .contact-card-modern.cpage--visible,
.contact-wrapper.cpage--visible,
.map-container-modern.cpage--visible {
opacity: 1;
transform: translateY(0);
}
/* Stagger de las tarjetas */
.contact-cards .contact-card-modern:nth-child(1) {
transition-delay: 0s;
}
.contact-cards .contact-card-modern:nth-child(2) {
transition-delay: 0.1s;
}
.contact-cards .contact-card-modern:nth-child(3) {
transition-delay: 0.2s;
}
/* ---------- TARJETAS DE CONTACTO ---------- */
.contact-card-modern {
cursor: default;
will-change: transform, box-shadow;
}
.contact-card-modern:hover {
transform: translateY(-8px) scale(1.01);
border-color: var(--accent) !important;
box-shadow:
0 20px 48px rgba(4, 205, 255, 0.13),
var(--shadow-xl);
}
/* Barra superior animada al hover */
.contact-card-modern > div:first-child {
transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1) !important;
}
.contact-card-modern:hover > div:first-child {
transform: scaleX(1) !important;
}
/* Icono con micro-animación */
.contact-card-modern:hover div[style*="border-radius: 20px"] {
transform: scale(1.08) rotate(6deg);
box-shadow: 0 8px 24px rgba(4, 205, 255, 0.25);
}
/* Links internos de las tarjetas */
.contact-card-modern a[href^="tel"],
.contact-card-modern a[href^="https://maps"] {
position: relative;
overflow: hidden;
}
.contact-card-modern a[href^="tel"]:hover,
.contact-card-modern a[href^="https://maps"]:hover {
background: rgba(4, 205, 255, 0.08) !important;
color: var(--accent) !important;
transform: translateY(-2px);
border-radius: 8px;
}
/* ---------- WRAPPER CONTACTO (formulario + info) ---------- */
.contact-wrapper {
will-change: transform;
}
.contact-wrapper:hover {
transform: translateY(-4px);
box-shadow:
0 30px 60px rgba(0, 0, 0, 0.2),
var(--shadow-xl);
}
/* ---------- INFO ROW ---------- */
.info-row {
cursor: default;
will-change: transform;
}
.info-row:hover {
transform: translateX(8px);
background: var(--surface) !important;
box-shadow: 0 4px 16px rgba(4, 205, 255, 0.08);
}
/* Icono del info-row gira sutilmente */
.info-row:hover div[style*="background: var(--accent-gradient)"] {
transform: rotate(-6deg) scale(1.05);
transition: transform 0.25s ease;
}
/* ---------- REDES SOCIALES ---------- */
.social-link-modern {
position: relative;
overflow: hidden;
}
.social-link-modern::after {
content: "";
position: absolute;
inset: 0;
background: var(--accent-gradient);
opacity: 0;
border-radius: 12px;
transition: opacity 0.25s ease;
}
.social-link-modern:hover::after {
opacity: 1;
}
.social-link-modern:hover {
color: white !important;
transform: translateY(-4px) scale(1.08);
box-shadow: 0 8px 20px rgba(4, 205, 255, 0.3);
}
.social-link-modern i {
position: relative;
z-index: 1;
}
/* ---------- FORMULARIO — INPUTS ---------- */
.form-group-modern {
position: relative;
}
/* Label flotante simulado mediante placeholder + focus */
.form-group-modern input,
.form-group-modern textarea,
.form-group-modern select {
outline: none !important;
box-sizing: border-box;
}
.form-group-modern input:focus,
.form-group-modern textarea:focus,
.form-group-modern select:focus {
border-color: var(--accent) !important;
box-shadow: 0 0 0 4px rgba(4, 205, 255, 0.12) !important;
transform: translateY(-2px);
background: var(--surface) !important;
}
/* Estado valid — borde verde sutil */
.form-group-modern input:not(:placeholder-shown):not(.error):not(:focus),
.form-group-modern textarea:not(:placeholder-shown):not(.error):not(:focus) {
border-color: rgba(0, 255, 136, 0.4) !important;
}
/* ---------- CHECKBOX PERSONALIZADO ---------- */
#privacy_checkbox {
appearance: none;
-webkit-appearance: none;
width: 18px !important;
height: 18px !important;
border: 2px solid var(--border);
border-radius: 5px;
background: var(--surface-light);
cursor: pointer;
position: relative;
flex-shrink: 0;
transition:
border-color 0.2s,
background 0.2s,
box-shadow 0.2s;
}
#privacy_checkbox:checked {
background: var(--accent, #04cdff);
border-color: var(--accent, #04cdff);
box-shadow: 0 0 0 3px rgba(4, 205, 255, 0.2);
}
#privacy_checkbox:checked::after {
content: "";
position: absolute;
top: 2px;
left: 5px;
width: 5px;
height: 9px;
border: 2px solid #000;
border-top: none;
border-left: none;
transform: rotate(45deg);
}
#privacy_checkbox:hover {
border-color: var(--accent);
}
/* ---------- BOTÓN SUBMIT ---------- */
.submit-btn-modern {
letter-spacing: 0.02em;
isolation: isolate;
}
.submit-btn-modern::before {
content: "";
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
background: rgba(255, 255, 255, 0.25);
border-radius: 50%;
transform: translate(-50%, -50%);
transition:
width 0.55s cubic-bezier(0.22, 1, 0.36, 1),
height 0.55s cubic-bezier(0.22, 1, 0.36, 1);
z-index: 0;
}
.submit-btn-modern:hover::before {
width: 340px;
height: 340px;
}
.submit-btn-modern > * {
position: relative;
z-index: 1;
}
.submit-btn-modern:hover {
transform: translateY(-3px);
box-shadow: 0 12px 32px rgba(4, 205, 255, 0.35);
gap: 16px !important;
}
.submit-btn-modern:active {
transform: translateY(0) scale(0.98);
box-shadow: none;
}
.submit-btn-modern:disabled {
opacity: 0.65;
cursor: not-allowed;
transform: none !important;
}
/* Icono flecha se mueve al hover */
.submit-btn-modern:hover .fa-arrow-right {
transform: translateX(4px);
transition: transform 0.2s ease;
}
/* ---------- ICONO PAPER PLANE (header formulario) ---------- */
.form-panel .fa-paper-plane {
transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
display: inline-block;
}
.form-panel:hover .fa-paper-plane {
transform: translateX(6px) translateY(-6px) rotate(15deg);
}
/* ---------- MAPA ---------- */
.map-container-modern {
will-change: transform;
}
.map-container-modern:hover {
transform: translateY(-5px);
box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18) !important;
}
.map-container-modern:hover iframe {
filter: grayscale(0) !important;
}
/* ---------- WHATSAPP FLOAT ---------- */
.whatsapp-float-modern a {
will-change: transform;
}
.whatsapp-float-modern a:hover {
transform: scale(1.05) translateY(-3px);
box-shadow: 0 12px 32px rgba(37, 211, 102, 0.55) !important;
gap: 16px !important;
}
.whatsapp-float-modern a:active {
transform: scale(0.97);
}
/* Animación del pulso */
@keyframes pulseRing {
0% {
transform: scale(1);
opacity: 0.5;
}
100% {
transform: scale(1.6);
opacity: 0;
}
}
/* Badge "en línea" pulsante sobre el botón de WA */
.whatsapp-float-modern {
position: fixed;
bottom: 30px;
right: 30px;
z-index: 1000;
}
.whatsapp-float-modern::before {
content: "";
position: absolute;
top: -4px;
right: -4px;
width: 14px;
height: 14px;
background: #00ff88;
border-radius: 50%;
border: 2px solid #fff;
animation: cpage-online-pulse 2s infinite;
z-index: 2;
}
@keyframes cpage-online-pulse {
0%,
100% {
transform: scale(1);
box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.6);
}
50% {
transform: scale(1.15);
box-shadow: 0 0 0 6px rgba(0, 255, 136, 0);
}
}
/* ---------- ALERTAS ---------- */
.alert {
padding: 1rem 1.25rem;
border-radius: 14px;
margin-top: 1rem;
animation: cpage-fadeInUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
display: flex;
align-items: center;
gap: 10px;
font-size: 0.92rem;
font-weight: 500;
}
.alert-success {
background: rgba(0, 255, 136, 0.08);
border: 1px solid rgba(0, 255, 136, 0.5);
color: #00ff88;
box-shadow: 0 4px 16px rgba(0, 255, 136, 0.1);
}
.alert-error {
background: rgba(255, 68, 68, 0.08);
border: 1px solid rgba(255, 68, 68, 0.5);
color: #ff4444;
box-shadow: 0 4px 16px rgba(255, 68, 68, 0.1);
}
.alert-info {
background: rgba(4, 205, 255, 0.08);
border: 1px solid rgba(4, 205, 255, 0.4);
color: var(--accent);
}
/* Icono en alertas */
.alert i {
font-size: 1.1rem;
flex-shrink: 0;
}
@keyframes cpage-fadeInUp {
from {
opacity: 0;
transform: translateY(12px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* ---------- CAMPO CON ERROR (shake mejorado) ---------- */
input.error,
textarea.error,
select.error {
border-color: #ff4444 !important;
box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.12) !important;
animation: cpage-shake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes cpage-shake {
0%,
100% {
transform: translateX(0);
}
15% {
transform: translateX(-6px);
}
30% {
transform: translateX(5px);
}
45% {
transform: translateX(-4px);
}
60% {
transform: translateX(3px);
}
75% {
transform: translateX(-2px);
}
}
/* ---------- CONTADOR DE CARACTERES (indicador de color dinámico) ---------- */
.char-counter {
font-weight: 500;
}
/* ---------- SKELETON LOADER para imágenes (progressive) ---------- */
@keyframes cpage-shimmer {
0% {
background-position: -400px 0;
}
100% {
background-position: 400px 0;
}
}
/* ---------- INTL-TEL-INPUT (alineado al tema) ---------- */
.iti {
width: 100%;
display: block !important;
}
.iti__flag-container {
border-radius: 12px 0 0 12px;
}
.iti--allow-dropdown .iti__flag-container:hover .iti__selected-flag {
background-color: rgba(4, 205, 255, 0.08);
border-radius: 12px 0 0 12px;
}
.iti__selected-flag {
padding: 0 12px;
border-radius: 12px 0 0 12px;
background: var(--surface-light);
}
.iti__country-list {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
box-shadow: var(--shadow-lg);
backdrop-filter: blur(12px);
}
.iti__country:hover {
background: var(--surface-light);
}
.iti__highlight {
background: rgba(4, 205, 255, 0.15);
}
/* ---------- TOOLTIP en links de teléfono ---------- */
#tel1-contacto,
#tel3-contacto {
position: relative;
}
#tel1-contacto::after {
content: "Abrir WhatsApp";
position: absolute;
bottom: calc(100% + 8px);
left: 50%;
transform: translateX(-50%) scale(0.85);
background: #25d366;
color: #fff;
font-size: 0.72rem;
font-weight: 600;
padding: 4px 10px;
border-radius: 6px;
white-space: nowrap;
pointer-events: none;
opacity: 0;
transition:
opacity 0.2s,
transform 0.2s;
}
#tel1-contacto:hover::after {
opacity: 1;
transform: translateX(-50%) scale(1);
}
#tel3-contacto::after {
content: "Llamar ahora";
position: absolute;
bottom: calc(100% + 8px);
left: 50%;
transform: translateX(-50%) scale(0.85);
background: var(--accent, #04cdff);
color: #000;
font-size: 0.72rem;
font-weight: 600;
padding: 4px 10px;
border-radius: 6px;
white-space: nowrap;
pointer-events: none;
opacity: 0;
transition:
opacity 0.2s,
transform 0.2s;
}
#tel3-contacto:hover::after {
opacity: 1;
transform: translateX(-50%) scale(1);
}
/* ---------- RESPONSIVE ---------- */
@media (max-width: 992px) {
.contact-wrapper {
grid-template-columns: 1fr !important;
}
.info-panel {
order: 2;
}
.form-panel {
order: 1;
}
}
@media (max-width: 768px) {
.cards-grid {
grid-template-columns: 1fr !important;
}
.form-panel {
padding: 1.5rem !important;
}
.info-panel {
padding: 1.5rem !important;
}
.whatsapp-float-modern span {
display: none !important;
}
.whatsapp-float-modern a {
padding: 1rem !important;
}
.whatsapp-float-modern::before {
top: 2px;
right: 2px;
}
}
@media (max-width: 640px) {
.contact-wrapper div[style*="grid-template-columns: 1fr 1fr"] {
grid-template-columns: 1fr !important;
}
}
/* ---------- FOCUS VISIBLE (accesibilidad) ---------- */
.contact-card-modern a:focus-visible,
.submit-btn-modern:focus-visible,
.social-link-modern:focus-visible,
#tel1-contacto:focus-visible,
#tel3-contacto:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 3px;
border-radius: 8px;
}

View File

@ -0,0 +1,251 @@
/* ==================== */
/* COMPONENTE: GALERÍA PREMIUM MODERNA */
/* ==================== */
.gallery-premium {
padding: 5rem clamp(1rem, 3vw, 2rem);
max-width: var(--max-width);
margin: 0 auto;
background: linear-gradient(135deg, var(--primary) 0%, var(--surface) 100%);
border-radius: 40px;
margin-top: 2rem;
margin-bottom: 2rem;
position: relative;
overflow: hidden;
}
/* Background decoration */
.gallery-premium::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
height: 100%;
background: radial-gradient(
circle at 20% 50%,
rgba(var(--accent-rgb), 0.03) 0%,
transparent 50%
);
pointer-events: none;
}
.gallery-premium-header {
text-align: center;
margin-bottom: 4rem;
position: relative;
}
.gallery-premium-subtitle {
display: inline-flex;
align-items: center;
gap: 8px;
background: rgba(var(--accent-rgb), 0.1);
backdrop-filter: blur(10px);
padding: 0.5rem 1.5rem;
border-radius: 50px;
color: var(--accent);
font-size: 0.9rem;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 2px;
margin-bottom: 1rem;
border: 1px solid rgba(var(--accent-rgb), 0.2);
}
.gallery-premium-title {
font-family: "Space Grotesk", sans-serif;
font-size: clamp(2rem, 4vw, 3rem);
font-weight: 700;
margin-bottom: 1rem;
background: linear-gradient(
135deg,
var(--text-primary) 0%,
var(--accent) 100%
);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
.gallery-premium-description {
color: var(--text-secondary);
font-size: 1.1rem;
max-width: 600px;
margin: 0 auto;
}
/* Grid de galería estilo Masonry */
.gallery-premium-container {
column-count: 4;
column-gap: 1.5rem;
margin-bottom: 3rem;
position: relative;
}
@media (max-width: 1200px) {
.gallery-premium-container {
column-count: 3;
}
}
@media (max-width: 768px) {
.gallery-premium-container {
column-count: 2;
}
}
@media (max-width: 480px) {
.gallery-premium-container {
column-count: 1;
}
}
/* Items de galería */
.gallery-item {
break-inside: avoid;
margin-bottom: 1.5rem;
position: relative;
border-radius: 24px;
overflow: hidden;
cursor: pointer;
transform: translateY(0);
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.gallery-item:hover {
transform: translateY(-10px);
}
.gallery-image-wrapper {
position: relative;
overflow: hidden;
border-radius: 24px;
background: var(--surface-light);
}
.gallery-image {
width: 100%;
height: auto;
display: block;
transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.gallery-item:hover .gallery-image {
transform: scale(1.08);
}
/* Overlay moderno */
.gallery-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(
135deg,
rgba(0, 0, 0, 0.85) 0%,
rgba(0, 0, 0, 0.4) 50%,
transparent 100%
);
display: flex;
flex-direction: column;
justify-content: flex-end;
padding: 1.5rem;
opacity: 0;
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.gallery-item:hover .gallery-overlay {
opacity: 1;
}
.gallery-info {
transform: translateY(20px);
transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.gallery-item:hover .gallery-info {
transform: translateY(0);
}
.gallery-title {
color: white;
font-size: 1.1rem;
font-weight: 700;
margin-bottom: 0.25rem;
display: flex;
align-items: center;
gap: 8px;
}
.gallery-title i {
font-size: 0.9rem;
opacity: 0;
transform: translateX(-10px);
transition: all 0.3s ease;
}
.gallery-item:hover .gallery-title i {
opacity: 1;
transform: translateX(0);
}
/* Badge de zoom */
.zoom-badge {
position: absolute;
top: 1rem;
right: 1rem;
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px);
padding: 0.5rem;
border-radius: 50%;
width: 35px;
height: 35px;
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
transform: scale(0);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.gallery-item:hover .zoom-badge {
opacity: 1;
transform: scale(1);
}
.zoom-badge i {
color: white;
font-size: 1rem;
}
/* Contador de imágenes */
.gallery-stats {
text-align: center;
margin-top: 2rem;
color: var(--text-secondary);
font-size: 0.9rem;
}
/* Animaciones de entrada */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.gallery-item {
animation: fadeInUp 0.6s ease-out forwards;
opacity: 0;
}
/* Scroll reveal animation */
.gallery-item.revealed {
animation: fadeInUp 0.6s ease-out forwards;
}

View File

@ -0,0 +1,243 @@
/* ==================== */
/* COMPONENTE: ACORDEÓN FAQ PREMIUM */
/* ==================== */
.faq-premium {
padding: 5rem clamp(1rem, 3vw, 2rem);
max-width: var(--max-width);
margin: 0 auto;
background: linear-gradient(135deg, var(--surface) 0%, var(--primary) 100%);
border-radius: 40px;
margin-top: 2rem;
margin-bottom: 2rem;
position: relative;
overflow: hidden;
}
/* Background decoration */
.faq-premium::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
height: 100%;
background: radial-gradient(
circle at 80% 30%,
rgba(var(--accent-rgb), 0.03) 0%,
transparent 60%
);
pointer-events: none;
}
.faq-premium-header {
text-align: center;
margin-bottom: 4rem;
position: relative;
}
.faq-premium-subtitle {
display: inline-flex;
align-items: center;
gap: 8px;
background: rgba(var(--accent-rgb), 0.1);
backdrop-filter: blur(10px);
padding: 0.5rem 1.5rem;
border-radius: 50px;
color: var(--accent);
font-size: 0.9rem;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 2px;
margin-bottom: 1rem;
border: 1px solid rgba(var(--accent-rgb), 0.2);
}
.faq-premium-title {
font-family: "Space Grotesk", sans-serif;
font-size: clamp(2rem, 4vw, 3rem);
font-weight: 700;
margin-bottom: 1rem;
background: linear-gradient(
135deg,
var(--text-primary) 0%,
var(--accent) 100%
);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
.faq-premium-description {
color: var(--text-secondary);
font-size: 1.1rem;
max-width: 600px;
margin: 0 auto;
}
/* Layout del acordeón - Una sola columna */
.faq-premium-container {
max-width: 900px;
margin: 0 auto;
position: relative;
}
/* Estilos del acordeón */
.faq-accordion {
background: rgba(var(--surface-rgb), 0.6);
backdrop-filter: blur(10px);
border-radius: 24px;
overflow: hidden;
transition: all 0.3s ease;
border: 1px solid rgba(var(--accent-rgb), 0.1);
margin-bottom: 1rem;
}
.faq-accordion:hover {
border-color: rgba(var(--accent-rgb), 0.3);
transform: translateY(-2px);
}
.faq-accordion.active {
border-color: rgba(var(--accent-rgb), 0.5);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
.faq-accordion-title {
padding: 1.25rem 1.5rem;
cursor: pointer;
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
transition: all 0.3s ease;
background: linear-gradient(
135deg,
rgba(var(--surface-rgb), 0.8) 0%,
rgba(var(--surface-rgb), 0.4) 100%
);
}
.faq-accordion-title h4 {
font-size: 1rem;
font-weight: 600;
margin: 0;
color: var(--text-primary);
line-height: 1.4;
flex: 1;
}
.faq-accordion-icon {
width: 32px;
height: 32px;
min-width: 32px;
display: flex;
align-items: center;
justify-content: center;
background: rgba(var(--accent-rgb), 0.1);
border-radius: 50%;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.faq-accordion.active .faq-accordion-icon {
background: var(--accent);
transform: rotate(180deg);
}
.faq-accordion-icon i {
color: var(--accent);
font-size: 0.9rem;
transition: all 0.3s ease;
}
.faq-accordion.active .faq-accordion-icon i {
color: white;
}
.faq-accordion-content {
max-height: 0;
overflow: hidden;
transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
background: rgba(var(--surface-rgb), 0.3);
}
.faq-accordion.active .faq-accordion-content {
max-height: 2000px;
}
.faq-accordion-inner {
padding: 0 1.5rem 1.5rem 1.5rem;
color: var(--text-secondary);
line-height: 1.7;
font-size: 0.95rem;
}
.faq-accordion-inner p {
margin-bottom: 1rem;
}
.faq-accordion-inner p:last-child {
margin-bottom: 0;
}
.faq-accordion-inner a {
color: var(--accent);
text-decoration: none;
transition: all 0.3s ease;
}
.faq-accordion-inner a:hover {
text-decoration: underline;
}
/* Estadísticas FAQ */
.faq-stats {
text-align: center;
margin-top: 3rem;
padding-top: 2rem;
border-top: 1px solid rgba(var(--accent-rgb), 0.1);
color: var(--text-secondary);
font-size: 0.9rem;
}
.faq-stats i {
color: var(--accent);
margin-right: 0.5rem;
}
/* Animaciones de entrada */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.faq-accordion {
animation: fadeInUp 0.6s ease-out forwards;
opacity: 0;
}
.faq-accordion.revealed {
animation: fadeInUp 0.6s ease-out forwards;
}
/* Responsive */
@media (max-width: 768px) {
.faq-accordion-title {
padding: 1rem;
}
.faq-accordion-title h4 {
font-size: 0.9rem;
}
.faq-accordion-inner {
padding: 0 1rem 1rem 1rem;
font-size: 0.9rem;
}
}

Some files were not shown because too many files have changed in this diff Show More