PHPackages                             globalx/laravel-globalx - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. globalx/laravel-globalx

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

globalx/laravel-globalx
=======================

Biblioteca compartilhada Globalx para microserviços Laravel com funcionalidades de gerenciamento de erros, logging, integrações e API Gateway

01PHP

Since Oct 23Pushed 6mo agoCompare

[ Source](https://github.com/qpgtech/laravel-globalx)[ Packagist](https://packagist.org/packages/globalx/laravel-globalx)[ RSS](/packages/globalx-laravel-globalx/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Globalx Laravel Package
=======================

[](#globalx-laravel-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4033654b4398e4d234e622a66491fe1d5fbc56c0b45ce1f043185956456e454f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676c6f62616c782f6c61726176656c2d676c6f62616c782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/globalx/laravel-globalx)[![Total Downloads](https://camo.githubusercontent.com/6f15f94721cf6e695f28147e9ecfa1d09dde5be7bf7baea534c53aa3c9b43a99/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676c6f62616c782f6c61726176656c2d676c6f62616c782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/globalx/laravel-globalx)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Biblioteca compartilhada Globalx para microserviços Laravel com funcionalidades de gerenciamento de erros, logging, integrações e API Gateway.

Instalação
----------

[](#instalação)

Você pode instalar o pacote via Composer:

```
composer require globalx/laravel-globalx
```

O pacote será automaticamente descoberto pelo Laravel. Se você estiver usando uma versão mais antiga do Laravel, registre o service provider no arquivo `config/app.php`:

```
'providers' => [
    // ...
    Globalx\LaravelGlobalx\GlobalxServiceProvider::class,
],
```

Configuração
------------

[](#configuração)

Publique os arquivos de configuração:

```
php artisan vendor:publish --tag=globalx-config
```

Isso criará os arquivos de configuração em `config/globalx/`:

- `log.php` - Configurações de logging
- `integration.php` - Configurações de integração
- `apigateway.php` - Configurações do API Gateway

Configuração de Ambiente
------------------------

[](#configuração-de-ambiente)

Adicione as seguintes variáveis ao seu arquivo `.env`:

```
# API Gateway
API_GATEWAY_URL=https://api-gateway.example.com
JOSE_SECRET=your-secret-key

# Logging
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
```

Uso
---

[](#uso)

### ErrorManager

[](#errormanager)

Gerenciamento centralizado de erros com códigos únicos por microserviço.

```
use Globalx\LaravelGlobalx\Facades\ErrorManager;

// Obter resposta de erro
$errorResponse = ErrorManager::getErrorResponse('10001', 'pt_BR');

// Verificar se erro existe
$exists = ErrorManager::errorExists('10001');

// Obter todos os erros
$allErrors = ErrorManager::getAllErrors('pt_BR');
```

### LogManager

[](#logmanager)

Sistema de logging com channels específicos por aplicação.

```
use Globalx\LaravelGlobalx\Facades\LogManager;
use Globalx\LaravelGlobalx\LogManager\Enums\LogType;

// Escrever log
LogManager::write('myapp', LogType::Application, 'info', 'User logged in', ['user_id' => 123]);

// Métodos de conveniência
LogManager::info('myapp', 'User logged in', ['user_id' => 123]);
LogManager::warning('myapp', 'Deprecated feature used');
LogManager::error('myapp', 'Database connection failed');
LogManager::debug('myapp', 'Debug information', ['data' => $data]);
```

### Integration

[](#integration)

Biblioteca para consumo de integrações externas com suporte a base64.

```
use Globalx\LaravelGlobalx\Facades\Integration;

// GET request
$response = Integration::get('https://api.example.com/data');

// POST request
$response = Integration::post('https://api.example.com/data', ['key' => 'value']);

// PUT request
$response = Integration::put('https://api.example.com/data/1', ['key' => 'value']);

// DELETE request
$response = Integration::delete('https://api.example.com/data/1');
```

### ApiGateway

[](#apigateway)

Comunicação com API Gateway incluindo headers JOSE automáticos.

```
use Globalx\LaravelGlobalx\Facades\ApiGateway;

// GET request
$response = ApiGateway::get('users', ['page' => 1]);

// POST request
$response = ApiGateway::post('users', ['name' => 'John Doe']);

// PUT request
$response = ApiGateway::put('users/1', ['name' => 'Jane Doe']);

// DELETE request
$response = ApiGateway::delete('users/1');
```

Playgrounds
-----------

[](#playgrounds)

O pacote inclui endpoints de playground para testar as funcionalidades:

- `GET /api/v1/globalx/` - Informações do pacote
- `GET /api/v1/globalx/health` - Health check
- `GET /api/v1/globalx/error-manager/` - ErrorManager playground
- `GET /api/v1/globalx/log/` - LogManager playground
- `GET /api/v1/globalx/integration/` - Integration playground
- `GET /api/v1/globalx/apigateway/` - ApiGateway playground

Estrutura do Pacote
-------------------

[](#estrutura-do-pacote)

```
src/
├── ErrorManager/           # Gerenciamento de erros
│   ├── DTOs/
│   ├── Enums/
│   ├── Services/
│   └── ErrorManager.php
├── LogManager/             # Sistema de logging
│   ├── Enums/
│   ├── Services/
│   └── LogManager.php
├── Integration/            # Integrações externas
│   ├── DTOs/
│   ├── Enums/
│   ├── Services/
│   └── Integration.php
├── ApiGateway/            # Comunicação com API Gateway
│   ├── DTOs/
│   ├── Enums/
│   ├── Services/
│   └── ApiGateway.php
├── Facades/               # Facades do Laravel
├── config/               # Arquivos de configuração
├── lang/                 # Arquivos de localização
└── routes/               # Rotas do pacote

```

Testes
------

[](#testes)

```
composer test
```

Contribuição
------------

[](#contribuição)

Por favor, veja [CONTRIBUTING.md](CONTRIBUTING.md) para detalhes.

Licença
-------

[](#licença)

O MIT License (MIT). Por favor, veja [License File](LICENSE.md) para mais informações.

Changelog
---------

[](#changelog)

Por favor, veja [CHANGELOG.md](CHANGELOG.md) para mais informações sobre o que mudou recentemente.

Suporte
-------

[](#suporte)

Se você descobrir algum problema de segurança, por favor envie um e-mail para  ao invés de usar o issue tracker.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance46

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/23c6649fe315753442417146863ffe4489a2d1223caa23922b35a4e3b584a1f0?d=identicon)[qptech](/maintainers/qptech)

---

Top Contributors

[![gabrielfjanuario](https://avatars.githubusercontent.com/u/32471890?v=4)](https://github.com/gabrielfjanuario "gabrielfjanuario (2 commits)")

### Embed Badge

![Health badge](/badges/globalx-laravel-globalx/health.svg)

```
[![Health](https://phpackages.com/badges/globalx-laravel-globalx/health.svg)](https://phpackages.com/packages/globalx-laravel-globalx)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
