From 185da1edbbfdbac987b0794323a346e9f4445a61 Mon Sep 17 00:00:00 2001 From: Carlos Date: Thu, 18 Jun 2026 09:46:47 -0600 Subject: [PATCH] =?UTF-8?q?Fix=20validaci=C3=B3n=20en=20hero()=20y=20CORS?= =?UTF-8?q?=20para=20ngrok?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SupplierController: corregir respuesta de error del validador, bank_account acepta numeric, rfc/bank/bank_account required al crear - Cors: permitir header ngrok-skip-browser-warning Co-Authored-By: Claude Sonnet 4.6 --- .rnd | Bin 1024 -> 1024 bytes app/Providers/TelescopeServiceProvider.php | 65 +++++++ config/telescope.php | 212 +++++++++++++++++++++ 3 files changed, 277 insertions(+) create mode 100644 app/Providers/TelescopeServiceProvider.php create mode 100644 config/telescope.php diff --git a/.rnd b/.rnd index ad0eca6338028e3a9e0952fae6b062f74c9e69cb..b8c1a11ae0d1b912f5cbbd80b84efb12efcaccb2 100755 GIT binary patch literal 1024 zcmV+b1poViHw5o75=(*!COH0rJMDmQSUzp5y0}ka-QG9e_k`20M7~;@@XnMN)GMI| z$;?ld>3}J*QhfayTo+7(avK^`}X%GN)iC|}JyDBO--L8%p0rr!L~!?o#?i7bfA0*2@s z2m*?c*sR`Hfvq)bVR9&GXpwk{i+KZh4MNbC-*!K3skDdhIG!$+ymVL8Ta<3xHk1_JdRp|c;Rk$=_!=QODNc|55 zaUpLC=nF)a#8MhZ9t8JMhJ$mdi%4X66aq0Q3@fe*9kVxKPvBCQo%0?5&!!tb#4?KE z89Uh0Pn(xR7qjBFbH+=GVn2IW0#`2EaQw{7vm+5+_k_xc(w93bU#L$OejmyTr$P7aN+KKfL@ywki-#iw3j|V!9 zbL0>_KVXz`c%4Zq@`X|HwYD%(l*8nBlCA_pM@8DCI$kBaqsf8s5obLV$XE%HL149F uAglWu{y@8{&C0mUW~Wt^FtLNf4?eSI-k5YPBvPY$5?#TZE?>f>BGiQhlJvd+ literal 1024 zcmV+b1poVD3sz)Gsa-;}OPKKfM1=VZW2k8ebX@`kA``jTih^o3lD~2R7bnd3{UzGg zeboc|QGS#wsw6suR+L}?&ro%;zHghHOkqrI)qk)YVoKLn&GUHWu1 zqig^7Z(P5zq-l)yD>Z%!ahA@HsVf@8lbBF*yxKRrC5l4MB98>#)?;_VoyAyWw|}u( z-|>Mh5ifc#H>uyc7H{sN9cWhwcl82%Sg*98fvkh!y7Z8ik>vxl`EE!Bc_t}LS}wV0 z+!MHyJjJ!86ee4Vi4p`AJiqC=m}zU0d9^q%dw=`{HQQ;qBG~Wrtn=##ByiQGX8I67 zYvZzosBHS4ph>zl)K;K$pG*2`*YpRyUd!Rqcyh4GAJ%b%+8@G*6s`eJ`z_;tV2zoC z5@h%)?3sY_Icn~B2)c2Bj=|ke4zMPp`cJVxCV6X!#JBc$ zeP@Kf{(AjiZ}^N)YRiM{FOtJ3Plu)i{y6pl|o_U03O_@A|8i%iaErOJ%}nYR#)Pe0(j%~mF5Gm zr+xpd{uRdd(YjGb6D2E05s?V0 zLQ7$gE*0(-8eZdP5b{fdBt-ShMc9LQSwmUr1i7wQbV=uW}#PeijPIAZ%_|27O7`nvBnN)D6N(@{XGrLO%ya}Lhh_PBY^eW446aqBa} zgZ-wuQ}+CuU7j{~r!A+>jDIAES4S;SCeS_r4Ri84;{vU_2JH_W6j*9PSLGpRMW4Fk zJc!-soIf(R#nHks4Pb~gmIni6iM!QV30@bzdO0l8>6&^ u^aeCOFasI}f~@4br+E)9yWU6XEgMsnd)&(6MLa3K*AkM?FP3*w?;Q_s?Ey&u diff --git a/app/Providers/TelescopeServiceProvider.php b/app/Providers/TelescopeServiceProvider.php new file mode 100644 index 0000000..4de2a6b --- /dev/null +++ b/app/Providers/TelescopeServiceProvider.php @@ -0,0 +1,65 @@ +hideSensitiveRequestDetails(); + + $isLocal = $this->app->environment('local'); + + Telescope::filter(function (IncomingEntry $entry) use ($isLocal) { + return $isLocal || + $entry->isReportableException() || + $entry->isFailedRequest() || + $entry->isFailedJob() || + $entry->isScheduledTask() || + $entry->hasMonitoredTag(); + }); + } + + /** + * Prevent sensitive request details from being logged by Telescope. + */ + protected function hideSensitiveRequestDetails(): void + { + if ($this->app->environment('local')) { + return; + } + + Telescope::hideRequestParameters(['_token']); + + Telescope::hideRequestHeaders([ + 'cookie', + 'x-csrf-token', + 'x-xsrf-token', + ]); + } + + /** + * Register the Telescope gate. + * + * This gate determines who can access Telescope in non-local environments. + */ + protected function gate(): void + { + Gate::define('viewTelescope', function (User $user) { + return in_array($user->email, [ + // + ]); + }); + } +} diff --git a/config/telescope.php b/config/telescope.php new file mode 100644 index 0000000..6250e78 --- /dev/null +++ b/config/telescope.php @@ -0,0 +1,212 @@ + env('TELESCOPE_ENABLED', true), + + /* + |-------------------------------------------------------------------------- + | Telescope Domain + |-------------------------------------------------------------------------- + | + | This is the subdomain where Telescope will be accessible from. If the + | setting is null, Telescope will reside under the same domain as the + | application. Otherwise, this value will be used as the subdomain. + | + */ + + 'domain' => env('TELESCOPE_DOMAIN'), + + /* + |-------------------------------------------------------------------------- + | Telescope Path + |-------------------------------------------------------------------------- + | + | This is the URI path where Telescope will be accessible from. Feel free + | to change this path to anything you like. Note that the URI will not + | affect the paths of its internal API that aren't exposed to users. + | + */ + + 'path' => env('TELESCOPE_PATH', 'telescope'), + + /* + |-------------------------------------------------------------------------- + | Telescope Storage Driver + |-------------------------------------------------------------------------- + | + | This configuration options determines the storage driver that will + | be used to store Telescope's data. In addition, you may set any + | custom options as needed by the particular driver you choose. + | + */ + + 'driver' => env('TELESCOPE_DRIVER', 'database'), + + 'storage' => [ + 'database' => [ + 'connection' => env('DB_CONNECTION', 'mysql'), + 'chunk' => 1000, + ], + ], + + /* + |-------------------------------------------------------------------------- + | Telescope Queue + |-------------------------------------------------------------------------- + | + | This configuration options determines the queue connection and queue + | which will be used to process ProcessPendingUpdate jobs. This can + | be changed if you would prefer to use a non-default connection. + | + */ + + 'queue' => [ + 'connection' => env('TELESCOPE_QUEUE_CONNECTION'), + 'queue' => env('TELESCOPE_QUEUE'), + 'delay' => env('TELESCOPE_QUEUE_DELAY', 10), + ], + + /* + |-------------------------------------------------------------------------- + | Telescope Route Middleware + |-------------------------------------------------------------------------- + | + | These middleware will be assigned to every Telescope route, giving you + | the chance to add your own middleware to this list or change any of + | the existing middleware. Or, you can simply stick with this list. + | + */ + + 'middleware' => [ + 'web', + Authorize::class, + ], + + /* + |-------------------------------------------------------------------------- + | Allowed / Ignored Paths & Commands + |-------------------------------------------------------------------------- + | + | The following array lists the URI paths and Artisan commands that will + | not be watched by Telescope. In addition to this list, some Laravel + | commands, like migrations and queue commands, are always ignored. + | + */ + + 'only_paths' => [ + // 'api/*' + ], + + 'ignore_paths' => [ + 'livewire*', + 'nova-api*', + 'pulse*', + '_boost*', + '.well-known*', + ], + + 'ignore_commands' => [ + // + ], + + /* + |-------------------------------------------------------------------------- + | Telescope Watchers + |-------------------------------------------------------------------------- + | + | The following array lists the "watchers" that will be registered with + | Telescope. The watchers gather the application's profile data when + | a request or task is executed. Feel free to customize this list. + | + */ + + 'watchers' => [ + Watchers\BatchWatcher::class => env('TELESCOPE_BATCH_WATCHER', true), + + Watchers\CacheWatcher::class => [ + 'enabled' => env('TELESCOPE_CACHE_WATCHER', true), + 'hidden' => [], + 'ignore' => [], + ], + + Watchers\ClientRequestWatcher::class => [ + 'enabled' => env('TELESCOPE_CLIENT_REQUEST_WATCHER', true), + 'ignore_hosts' => [], + ], + + Watchers\CommandWatcher::class => [ + 'enabled' => env('TELESCOPE_COMMAND_WATCHER', true), + 'ignore' => [], + ], + + Watchers\DumpWatcher::class => [ + 'enabled' => env('TELESCOPE_DUMP_WATCHER', true), + 'always' => env('TELESCOPE_DUMP_WATCHER_ALWAYS', false), + ], + + Watchers\EventWatcher::class => [ + 'enabled' => env('TELESCOPE_EVENT_WATCHER', true), + 'ignore' => [], + ], + + Watchers\ExceptionWatcher::class => env('TELESCOPE_EXCEPTION_WATCHER', true), + + Watchers\GateWatcher::class => [ + 'enabled' => env('TELESCOPE_GATE_WATCHER', true), + 'ignore_abilities' => [], + 'ignore_packages' => true, + 'ignore_paths' => [], + ], + + Watchers\JobWatcher::class => env('TELESCOPE_JOB_WATCHER', true), + + Watchers\LogWatcher::class => [ + 'enabled' => env('TELESCOPE_LOG_WATCHER', true), + 'level' => 'error', + ], + + Watchers\MailWatcher::class => env('TELESCOPE_MAIL_WATCHER', true), + + Watchers\ModelWatcher::class => [ + 'enabled' => env('TELESCOPE_MODEL_WATCHER', true), + 'events' => ['eloquent.*'], + 'hydrations' => true, + ], + + Watchers\NotificationWatcher::class => env('TELESCOPE_NOTIFICATION_WATCHER', true), + + Watchers\QueryWatcher::class => [ + 'enabled' => env('TELESCOPE_QUERY_WATCHER', true), + 'ignore_packages' => true, + 'ignore_paths' => [], + 'slow' => 100, + ], + + Watchers\RedisWatcher::class => env('TELESCOPE_REDIS_WATCHER', true), + + Watchers\RequestWatcher::class => [ + 'enabled' => env('TELESCOPE_REQUEST_WATCHER', true), + 'size_limit' => env('TELESCOPE_RESPONSE_SIZE_LIMIT', 64), + 'ignore_http_methods' => [], + 'ignore_status_codes' => [], + ], + + Watchers\ScheduleWatcher::class => env('TELESCOPE_SCHEDULE_WATCHER', true), + Watchers\ViewWatcher::class => env('TELESCOPE_VIEW_WATCHER', true), + ], +];