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

Manager Laravel Package

graham-campbell/manager

Laravel Manager provides reusable manager functionality for Laravel apps. It helps you build driver-based services with a consistent API for creating, caching, and resolving implementations. Supports PHP 7.4–8.5 and Laravel 8–13.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Standardized Multi-Service Architecture: Accelerates adoption of a unified connection management pattern across Laravel packages, reducing technical debt from fragmented implementations (e.g., DatabaseManager, CacheManager). Enables teams to consolidate driver logic (e.g., payment gateways, APIs, storage) under a single interface, improving maintainability and reducing onboarding friction for developers.

    • Feature: Replace bespoke manager classes with AbstractManager to inherit connection pooling, config resolution, and dynamic extension.
    • Roadmap Tie: Critical for modularizing monolithic services (e.g., splitting AuthService into OAuth2/SAML/LDAP drivers) or migrating legacy Laravel 5/6 packages to Laravel 10+ while preserving custom logic.
  • Dynamic Driver Extensibility Without Code Changes: Supports configuration-driven extensibility, enabling:

    • SaaS Platforms: Let merchants add proprietary integrations (e.g., custom analytics tools, payment gateways) via Manager::extend() without deploying code changes.
    • Enterprise Customization: Extend core services (e.g., Manager::extend('logging', fn() => new DatadogLogger())) for compliance or legacy system integration.
    • Use Case: "Support 3+ cloud storage providers" → Abstract S3/GCS/Azure under a single StorageManager with runtime switching via config.
  • Build vs. Buy Decision:

    • Buy: Use this package to avoid reinventing connection management (e.g., for internal tools, SDKs, or Laravel-based APIs).
    • Build: Extend it to create custom manager patterns (e.g., TaskManager, WorkflowManager) when off-the-shelf solutions lack domain-specific features.
    • Cost Justification: Saves 3–5 dev days per manager implementation (connection pooling, config validation, dynamic extension).
  • Performance Optimization:

    • Connection Reuse: Reduces overhead from recreating connections (e.g., database, API clients) via connection()->method() caching.
    • Use Case: High-traffic APIs where connection churn (e.g., per-request DB reconnects) impacts latency.
  • Laravel Ecosystem Alignment:

    • Package Consistency: Aligns with Laravel’s native patterns (e.g., Illuminate\Support\Manager), reducing cognitive load for developers familiar with the framework.
    • Example: Teams using graham-campbell/flysystem or graham-campbell/digitalocean can leverage Manager for unified config and driver handling.

When to Consider This Package

  • Adopt When:

    • You’re building or maintaining Laravel packages that require dynamic service providers (e.g., databases, APIs, storage, payment gateways).
    • Your team needs to support multiple drivers (e.g., Stripe + PayPal) with runtime switching via config.
    • You’re migrating legacy Laravel 5/6 code to Laravel 8+ and want to modernize connection management without rewriting core logic.
    • You require zero-configuration extensibility (e.g., letting clients add custom drivers via Manager::extend()).
    • Your use case aligns with existing implementations like Flysystem, DigitalOcean, or GitHub Laravel packages.
  • Look Elsewhere When:

    • You need built-in GUI/config tools (e.g., Laravel Nova/Vue-based connection managers). This package is config/API-only.
    • Your drivers require stateful connections (e.g., WebSocket streams) beyond simple pooling. Consider Illuminate\Contracts\Queue\* or custom event-driven managers.
    • You’re using non-Laravel PHP frameworks (Symfony, Lumen-only features may need adaptation).
    • You need advanced monitoring/metrics for connections (e.g., Prometheus integration). This package focuses on core functionality.
    • Your team prefers fully managed services (e.g., AWS SDK, Guzzle HTTP client) over custom manager abstractions.

How to Pitch It (Stakeholders)

For Executives:

*"This package lets us standardize how Laravel services manage dynamic connections—like databases, APIs, or payment gateways—without reinventing the wheel. For example:

  • Saves 3–5 dev days per service by replacing custom connection managers with a proven, extensible base.
  • Enables SaaS customization (e.g., merchants adding their own payment tools) via config, not code.
  • Reduces technical debt by aligning with Laravel’s native patterns, making it easier to hire and onboard developers. Think of it as Laravel’s built-in dependency injection for services, but for connections. Used by packages like Flysystem and DigitalOcean, it’s battle-tested and MIT-licensed."

For Engineering Teams:

*"Problem: Every Laravel package with dynamic drivers (e.g., DatabaseManager, CacheManager) reinvents connection pooling, config resolution, and extension logic. Solution: graham-campbell/manager gives you:

  • AbstractManager: A drop-in base class for your custom managers (e.g., PaymentManager, AnalyticsManager) with built-in connection reuse and dynamic extension.
  • Zero Config: Just extend AbstractManager and implement createConnection(). No service providers or complex setup.
  • Runtime Flexibility: Add drivers via Manager::extend('stripe', fn() => new StripeClient()) without redeploying.
  • Laravel 8–13 Support: Works with modern PHP (7.4–8.5) and avoids deprecated patterns. Use Case: If you’re building a multi-cloud storage service or a SaaS platform with pluggable integrations, this cuts your implementation time by 60% while keeping it maintainable."*

For Developers:

*"Need a clean, tested way to manage multiple drivers (e.g., S3 + GCS + Azure) in Laravel? This package gives you:

  • Connection Pooling: Reuse connections instead of recreating them (e.g., manager->connection('s3')->put()).
  • Dynamic Drivers: Extend with Manager::extend() at runtime (e.g., manager->extend('custom', fn() => new MyDriver())).
  • Magic Methods: Call manager->method() directly on the default connection (e.g., manager->listBuckets() instead of manager->connection()->listBuckets()).
  • No Fluff: Zero config, no service providers—just extend AbstractManager and go. Example: Replace your custom StorageManager with this in <10 lines of code and get Laravel-native connection handling for free."*
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport