Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

App Registry Client Bundle Laravel Package

aeruz/app-registry-client-bundle

PHP/Laravel bundle that simplifies talking to an App Registry service. Provides a client wrapper for registering apps, fetching metadata, and keeping service discovery details in sync, with configuration suited for framework projects and shared deployments.

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation

    composer require aeruz/app-registry-client-bundle
    

    Add to config/app.php under extra.bundles:

    Aeruz\AppRegistryClientBundle\AeruzAppRegistryClientBundle::class
    
  2. Configuration Publish the default config:

    php artisan vendor:publish --provider="Aeruz\AppRegistryClientBundle\AeruzAppRegistryClientBundle" --tag="config"
    

    Update config/packages/aeruz_app_registry_client.yaml with your registry API endpoint and credentials.

  3. First Use Case Fetch application metadata:

    use Aeruz\AppRegistryClientBundle\Client\RegistryClientInterface;
    
    class MyService
    {
        public function __construct(private RegistryClientInterface $registryClient) {}
    
        public function getAppInfo(string $appId): array
        {
            return $this->registryClient->getApplication($appId);
        }
    }
    

Implementation Patterns

Core Workflows

  1. Application Discovery Use RegistryClientInterface to fetch app metadata:

    $apps = $this->registryClient->listApplications(['status' => 'active']);
    
  2. Dependency Resolution Resolve app dependencies recursively:

    $dependencies = $this->registryClient->getApplicationDependencies($appId, true);
    
  3. Event-Driven Updates Subscribe to registry webhooks (configure in config/packages/aeruz_app_registry_client.yaml):

    webhooks:
        enabled: true
        endpoint: /api/webhooks/registry
        events: ['application.updated', 'application.deployed']
    

Integration Tips

  • Service Container Binding Bind the client to a custom interface for easier testing:

    $this->app->bind(
        MyAppRegistryClient::class,
        fn() => $this->app->make(RegistryClientInterface::class)
    );
    
  • Caching Layer Cache responses for performance (Laravel Cache):

    $this->registryClient->setCacheDriver('redis');
    $this->registryClient->setCacheTTL(3600); // 1 hour
    
  • Async Operations Use Laravel Queues for long-running operations:

    dispatch(new SyncAppRegistry($appId));
    

Gotchas and Tips

Common Pitfalls

  1. Authentication Failures

    • Ensure config/packages/aeruz_app_registry_client.yaml has valid client_id/client_secret.
    • Debug with:
      php artisan aeruz:registry:debug
      
  2. Rate Limiting

    • The registry may throttle requests. Implement exponential backoff:
      $this->registryClient->setRetryPolicy(new RetryPolicy(3, 500));
      
  3. Webhook Verification

    • Always verify webhook payloads (use Aeruz\AppRegistryClientBundle\Webhook\Verifier):
      $verifier = new Verifier($this->app['config']['aeruz_app_registry.webhooks.secret']);
      if (!$verifier->verify($request->getContent(), $request->headers->get('X-Signature'))) {
          abort(403);
      }
      

Debugging

  • Enable verbose logging:
    logging:
        enabled: true
        level: debug
    
  • Check raw API responses:
    $response = $this->registryClient->getApplication($appId, ['debug' => true]);
    

Extension Points

  1. Custom Responses Override default response handling:

    $this->registryClient->setResponseTransformer(
        fn(array $data) => collect($data)->mapWithKeys(...)
    );
    
  2. Middleware Add custom middleware to the HTTP client:

    $this->registryClient->getClient()->pushMiddleware(
        new AddCustomHeader('X-My-Header', 'value')
    );
    
  3. Event Dispatching Listen for registry events:

    event(new ApplicationUpdated($appId, $data));
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle